File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -198,6 +198,15 @@ export default defineConfig({
198198 * Bundle the sanitizer and its parser dependency chain into the ESM
199199 * server output so no runtime require() of these packages occurs.
200200 *
201+ * The sanitizer's CommonJS runtime dependencies must be bundled for the
202+ * same reason. Rolldown emits externalized require() calls through a
203+ * createRequire() helper imported from a shared runtime chunk, and
204+ * @vercel /nft's static analysis cannot follow that indirection across
205+ * module boundaries — untraced packages are absent from the deployed
206+ * function and crash every action cold start with MODULE_NOT_FOUND.
207+ * Bundling the full dependency closure (launder -> dayjs, postcss ->
208+ * nanoid/picocolors/source-map-js) leaves no runtime require() behind.
209+ *
201210 * Build-only: in the dev server, Vite's SSR module runner evaluates
202211 * noExternal'd CommonJS packages as ESM, crashing the same action with
203212 * "ReferenceError: require is not defined". When the chain is
@@ -214,6 +223,16 @@ export default defineConfig({
214223 'domhandler' ,
215224 'domutils' ,
216225 'entities' ,
226+ 'deepmerge' ,
227+ 'escape-string-regexp' ,
228+ 'is-plain-object' ,
229+ 'launder' ,
230+ 'dayjs' ,
231+ 'parse-srcset' ,
232+ 'postcss' ,
233+ 'nanoid' ,
234+ 'picocolors' ,
235+ 'source-map-js' ,
217236 ]
218237 : [ ] ,
219238 } ,
You can’t perform that action at this time.
0 commit comments