I have an astro website and starting today when I build locally ‘astro dev/build’ will report the following error.
OS: Windows10
Node version: v20.16.0
Package manager: Pnpm v9.7.0
Astro version: v4.13.1
Error Message:
[vite] Error when evaluating SSR module F:oceanh_workspaceProjectblog-astroastro.config.mjs: failed to import “astro-icon”
|-file:///F:/oceanh_workspace/Project/blogastro/node_modules/.pnpm/@[email protected]/node_modules/@iconify/tools/lib/svg/index.mjs:1
import cheerio from ‘cheerio’;
^^^^^^^
SyntaxError: The requested module ‘cheerio’ does not provide an export named ‘default’
at ModuleJob.instantiate (node:internal/modules/esm/module_job:134:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:217:5)
at async nodeImport (file:///F:/oceanh_workspace/Project/blog-astro/node_modules/.pnpm/[email protected]@[email protected][email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:52928:15)
at async ssrImport (file:///F:/oceanh_workspace/Project/blog-astro/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:52786:16)
at async eval (F:/oceanh_workspace/Project/blog-astro/astro.config.mjs:10:31)
at async instantiateModule (file:///F:/oceanh_workspace/Project/blog-astro/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:52844:5)
[astro] Unable to load your Astro config
The requested module ‘cheerio’ does not provide an export named ‘default’
Stack trace:
at ModuleJob.instantiate (node:internal/modules/esm/module_job:134:21)
at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
at async ssrImport (file:///F:/oceanh_workspace/Project/blog-astro/node_modules/.pnpm/[email protected]@[email protected][email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:52786:16)
at async instantiateModule (file:///F:/oceanh_workspace/Project/blog-astro/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:52844:5)
ELIFECYCLE Command failed with exit code 1.
I’ve tried a lot of ways, like removing node_modules, clearing pnpm’s cache, updating dependent versions, and even rolling back the code to previous versions, but nothing has fixed the problem, which drives me crazy.Plz help me.
oceanhhan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.