New project from template-nextjs-personal-website page router, Cannot read properties of undefined (reading 'slug') #5005
Unanswered
ahelliet
asked this question in
Sanity Studio Support
Replies: 1 comment
-
Do you have any pages created in sanity studio? If sanity can't find a page to render for the slug URL you're at, that might be the issue it's likely this line: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I'm trying to build a sanity project from this template https://github.com/sanity-io/template-nextjs-personal-website, after setting up my env vars, on first launch i got this error in my console
TypeError: Cannot read properties of undefined (reading 'slug') at PageSlugRoute (webpack-internal:///./pages/[slug].tsx:28:27) at renderWithHooks (/Users/anthony/Desktop/report/node_modules/react-dom/cjs/react-dom-server.browser.development.js:5658:16) at renderIndeterminateComponent (/Users/anthony/Desktop/report/node_modules/react-dom/cjs/react-dom-server.browser.development.js:5731:15) at renderElement (/Users/anthony/Desktop/report/node_modules/react-dom/cjs/react-dom-server.browser.development.js:5946:7) at renderNodeDestructiveImpl (/Users/anthony/Desktop/report/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6104:11) at renderNodeDestructive (/Users/anthony/Desktop/report/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6076:14) at renderNode (/Users/anthony/Desktop/report/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6259:12) at renderChildrenArray (/Users/anthony/Desktop/report/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6211:7) at renderNodeDestructiveImpl (/Users/anthony/Desktop/report/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6141:7) at renderNodeDestructive (/Users/anthony/Desktop/report/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6076:14) at renderElement (/Users/anthony/Desktop/report/node_modules/react-dom/cjs/react-dom-server.browser.development.js:5971:9) at renderNodeDestructiveImpl (/Users/anthony/Desktop/report/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6104:11) at renderNodeDestructive (/Users/anthony/Desktop/report/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6076:14) at renderIndeterminateComponent (/Users/anthony/Desktop/report/node_modules/react-dom/cjs/react-dom-server.browser.development.js:5785:7) at renderElement (/Users/anthony/Desktop/report/node_modules/react-dom/cjs/react-dom-server.browser.development.js:5946:7) ⨯ pages/[slug].tsx (33:24) @ slug
After some research it seems to be related to the next-sanity package but i'm not 100% sure.
Does someone have encounter this and could help ?
Beta Was this translation helpful? Give feedback.
All reactions