No matching export but builds and runs fine locally

00:22:04.996 ✘ [ERROR] Build failed with 1 error:
00:22:04.996
00:22:04.997 ✘ [ERROR] No matching export in "../../node_modules/.pnpm/[email protected]/node_modules/marked/lib/marked.esm.js" for import "Slugger"
00:22:04.997
00:22:04.997 ../output/server/entries/pages/blog/_slug_/_page.svelte.js:2:9:
00:22:04.998 2 │ import { Slugger, Lexer, marked } from "marked";
00:22:04.998 ╵ ~~~~~~~
00:22:04.998
00:22:04.998
00:22:04.998
00:22:04.998
00:22:05.000
00:22:05.001 ✘ [ERROR] Build failed with 1 error:
00:22:05.002
00:22:05.002 ✘ [ERROR] No matching export in "../../node_modules/.pnpm/[email protected]/node_modules/marked/lib/marked.esm.js" for import "Slugger"
00:22:05.002
00:22:05.002 ../output/server/entries/pages/blog/_slug_/_page.svelte.js:2:9:
00:22:05.002 2 │ import { Slugger, Lexer, marked } from "marked";
00:22:05.002 ╵ ~~~~~~~
00:22:04.996 ✘ [ERROR] Build failed with 1 error:
00:22:04.996
00:22:04.997 ✘ [ERROR] No matching export in "../../node_modules/.pnpm/[email protected]/node_modules/marked/lib/marked.esm.js" for import "Slugger"
00:22:04.997
00:22:04.997 ../output/server/entries/pages/blog/_slug_/_page.svelte.js:2:9:
00:22:04.998 2 │ import { Slugger, Lexer, marked } from "marked";
00:22:04.998 ╵ ~~~~~~~
00:22:04.998
00:22:04.998
00:22:04.998
00:22:04.998
00:22:05.000
00:22:05.001 ✘ [ERROR] Build failed with 1 error:
00:22:05.002
00:22:05.002 ✘ [ERROR] No matching export in "../../node_modules/.pnpm/[email protected]/node_modules/marked/lib/marked.esm.js" for import "Slugger"
00:22:05.002
00:22:05.002 ../output/server/entries/pages/blog/_slug_/_page.svelte.js:2:9:
00:22:05.002 2 │ import { Slugger, Lexer, marked } from "marked";
00:22:05.002 ╵ ~~~~~~~
pnpm run build and pnpm run preview results in all my routes loading successfully without any errors. I'm not quite sure how to replicate or debug this.
1 Reply
Ajay
AjayOP4d ago
The solution to this was to include:
"resolutions": {
"marked": "^5.1.2"
}
"resolutions": {
"marked": "^5.1.2"
}
In my package.json. Another problem showed up with canceled promises, and turns out you must initialize your DB connection on every request (but you don't need to do this in Vercel).

Did you find this page helpful?