JEverhart383 / astro-wordpress-starter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot read properties of undefined (reading 'nodes')

spokospace opened this issue · comments

commented

Current Behavior

pnpm build is failing for application with the below error:

TypeError: Cannot read properties of undefined (reading 'nodes')
    at file:///C:/www/2023/blogv2/dist/server/chunks/prerender.3f1b1079.mjs:50668:15
    at AstroComponentInstance.Archive [as factory] (file:///C:/www/2023/blogv2/dist/server/chunks/astro.06a52d63.mjs:1244:12)
    at AstroComponentInstance.init (file:///C:/www/2023/blogv2/dist/server/chunks/astro.06a52d63.mjs:2072:29)
    at AstroComponentInstance.render (file:///C:/www/2023/blogv2/dist/server/chunks/astro.06a52d63.mjs:2077:18)
    at render.next (<anonymous>)
    at renderChild (file:///C:/www/2023/blogv2/dist/server/chunks/astro.06a52d63.mjs:2134:18)       
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async [Symbol.asyncIterator] (file:///C:/www/2023/blogv2/dist/server/chunks/astro.06a52d63.mjs:1800:7)
    at async renderAstroTemplateResult (file:///C:/www/2023/blogv2/dist/server/chunks/astro.06a52d63.mjs:1808:20)
    at async renderChild (file:///C:/www/2023/blogv2/dist/server/chunks/astro.06a52d63.mjs:2132:5)  
 ELIFECYCLE  Command failed with exit code 1.

Expected Behavior

pnpm build should run correctly

Steps to Reproduce

run pnpm build

Thanks for opening this issue. The type error here is because the Astro starter expects some data from WPGraphQL to be available and it's undefined. Is there any additional output to tell you which file is generating this error? Depending on your WordPress setup, you may need to add/enable a Primary Menu, or I've seen similar issues with some people's term URIs.

commented

hmm, idk why, but need tu unpublis my home page, then it works. I noticed if I use some folder and index.astro file for custom page then need to remove/unpublish this page in WordPress dashboard.