Thanks for reaching out! Sorry to hear you are encountering obstacles. Can you please share your project repo that corresponds with this site? This will help us look into your set up a bit more closely.
I am sorry for the late reply, I was a little busy exploring Nextjs and Netlify. I cannot share the project repo because of company policy. but I have created another project which has the same issue.
In your template, I can see youâre trying to access content/posts instead of content. So instead of content/*.md, you should probably include content/*.
Sorry for mentioning all of you guys. Itâs been so long since I have been facing this issue. and I have created an open-source template with nextjs in that time. still, I couldnât find any solutions from here or anywhere else. please give me a solution for this issue.
Iâve opened a PR to fix this. However, when I tried visiting a random page like /jugbj for example, the page still fails. The error in this case is:
TypeError: Cannot destructure property 'frontmatter' of 'pageData[0]' as it is undefined.
at getRegularPage (/var/task/.next/server/chunks/307.js:81:13)
at getStaticProps (/var/task/.next/server/pages/[regular].js:721:99)
at Object.renderToHTML (/var/task/node_modules/next/dist/server/render.js:451:26)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async doRender (/var/task/node_modules/next/dist/server/base-server.js:915:38)
at async cacheEntry.responseCache.get.isManualRevalidate.isManualRevalidate (/var/task/node_modules/next/dist/server/base-server.js:1020:28)
at async /var/task/node_modules/next/dist/server/response-cache.js:69:36
The problem appears to be something with the code for this particular path. Maybe thatâs expected, but I thought I should let you know.
Sorry for the previous message. your PR doesnât resolve this issue. I have checked the vercel link and thought it has been fixed. but itâs not working. really sorry about the miss information. Itâs still going to the 500 page
Since youâve not provided any additional details, Iâm assuming itâs the same error I have already reported in my last post. I think the stack trace was pretty clear to point out the cause of the issue.
In any case, Iâve raised another PR:
which fixes that issue. Iâm not sure if youâre having any other problem, as youâve not mentioned that.
Itâs still not ideal as it renders a different 404 page than youâd expect:
You can ignore the images for now, this was just a test.
Weâll confirm with the devs why thereâs a discrepancy in the local vs Netlify setup - but to your point, itâs indeed possible to host Next.js on Netlify.