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.