saicaca / fuwari

✨A static blog template built with Astro.
https://fuwari.vercel.app
MIT License
1.35k stars 311 forks source link

Error: Cannot read properties of undefined (reading 'enable') #164

Closed RiverKy closed 2 months ago

RiverKy commented 2 months ago

Getting this when trying to generate output.

14:32:44.692 | generating static routes
-- | --
14:32:44.806 | 06:32:44 ▶ src/pages/about.astro
14:32:45.093 | 06:32:44   └─ /about/index.htmlCannot read properties of undefined (reading 'enable')
14:32:45.093 | Stack trace:
14:32:45.094 | at file:///opt/buildhome/repo/dist/chunks/MainGridLayout_Dt27HMzC.mjs:4019:80
14:32:45.094 | at AstroComponentInstance.init (file:///opt/buildhome/repo/dist/chunks/astro/server_C6uIbJe3.mjs:965:29)
14:32:45.094 | at async renderToString (file:///opt/buildhome/repo/node_modules/.pnpm/astro@4.14.2_@types+node@20.14.12_lightningcss@1.25.1_rollup@2.79.1_sass@1.77.8_stylus@0.63.0_o6xqou5pcg7u7oz5cwfywlkcsm/node_modules/astro/dist/runtime/server/render/astro/render.js:19:5)
14:32:45.094 | at async lastNext (file:///opt/buildhome/repo/node_modules/.pnpm/astro@4.14.2_@types+node@20.14.12_lightningcss@1.25.1_rollup@2.79.1_sass@1.77.8_stylus@0.63.0_o6xqou5pcg7u7oz5cwfywlkcsm/node_modules/astro/dist/core/render-context.js:131:25)
14:32:45.094 | at async RenderContext.render (file:///opt/buildhome/repo/node_modules/.pnpm/astro@4.14.2_@types+node@20.14.12_lightningcss@1.25.1_rollup@2.79.1_sass@1.77.8_stylus@0.63.0_o6xqou5pcg7u7oz5cwfywlkcsm/node_modules/astro/dist/core/render-context.js:162:22)
14:32:45.143 | Failed: Error while executing user command. Exited with error code: 1
14:32:45.153 | Failed: build command exited with code: 1
14:32:46.150 | Failed: error occurred while running build command

Thank you.

RiverKy commented 2 months ago
> astro build && pagefind --site dist

3:17:39 PM [vite] Error when evaluating SSR module /Users/SkyYkb/Documents/Kais-Blog.nosync/astro.config.mjs: failed to import "astro-icon"
|- file:///Users/SkyYkb/Documents/Kais-Blog.nosync/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:171:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:254:5)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:482:26)
    at async nodeImport (file:///Users/SkyYkb/Documents/Kais-Blog.nosync/node_modules/vite/dist/node/chunks/dep-BzOvws4Y.js:52954:15)
    at async ssrImport (file:///Users/SkyYkb/Documents/Kais-Blog.nosync/node_modules/vite/dist/node/chunks/dep-BzOvws4Y.js:52812:16)
    at async eval (/Users/SkyYkb/Documents/Kais-Blog.nosync/astro.config.mjs:8:31)
    at async instantiateModule (file:///Users/SkyYkb/Documents/Kais-Blog.nosync/node_modules/vite/dist/node/chunks/dep-BzOvws4Y.js:52870: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:171:21)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:482:26)
    at async ssrImport (file:///Users/SkyYkb/Documents/Kais-Blog.nosync/node_modules/vite/dist/node/chunks/dep-BzOvws4Y.js:52812:16)
    at async instantiateModule (file:///Users/SkyYkb/Documents/Kais-Blog.nosync/node_modules/vite/dist/node/chunks/dep-BzOvws4Y.js:52870:5)
 ELIFECYCLE  Command failed with exit code 1.
RiverKy commented 2 months ago

The first output (that src/pages/about.astro one) is shown when building with Cloudflare Pages. And the second one (Error when evaluating SSR module) is shown when building locally. Not powerful enough for me to figure out what happened. Please help. Thanks.

nvkomata commented 2 months ago

looks kind of like #158, did you pnpm update?

RiverKy commented 2 months ago

pnpm update does solve the Error when evaluating SSR module error, while the src/pages/about.astro error is now appearing on my computer.

Thanks.

saicaca commented 2 months ago

Please check your src/config.ts to see if any configuration items are missing.

https://github.com/saicaca/fuwari/blob/main/src/config.ts

RiverKy commented 2 months ago

Problem solved after adding some items in src/config.ts. Updating Astro themes is really a tough job...

Thank you so much!