Describe the bug
Hi guys !
I have a simple static blog using NextJS 13. I use getStaticProps on all of my pages.
It works during development but the deployed application is broken : I have 500 error on pages where I use plaiceholder (rest of the website working well)
It’s Working well on Vercel so this should be something about sharp package or the build process on Netlify ?
Yes it’s a typo, it’s Next12.
I can’t send you any link because there is no working deploy + it’s not released at the moment on Netlify : all pages are in Error because all images are in error.
Additional information :
I have errors for each (3 on 3) of my /pages/api/ routes (routes displayed as functions inside Netlify dashboard).
api/revalidate : same error as described above → We are re-triggering a page build, so sharp is missing
/api/preview : missing front-end dependencies (non-sense because we are doing Simple nextJS preview as described in there documentation, just setting the preview cookie)
It’s a Netlify issue : I deployed the exact same code on Vercel.com and it’s working perfectly fine.
Conclusion : there are missing dependencies in Netlify Functions/Edge Functions. Please can you tell me how to add all the dependencies of my package.json in my Netlify function ? The missing packages are all inside dependencies (sharp, @netlify/classnames-template-literals, etc.), not in devDependencies or peerDependencies
By details, I meant your site name or ID, or deploy ID, build ID, or any such unique identifiers. We really need to see the site to be able to comment on what could be happening. Not sure why you don’t want to share it.
Since you don’t wish to share that basic piece of information, I can only guess:
That was for the Sharp issue. But your error seems to be complaining about something else that’s missing. So, not sure how to go beyond this.
After something like a week of struggles, it’s seems impossible on my side to have everything I want on my Netlify Function : always missing a different dependency.
Has it works out of the box in Vercel, I switched the hosting provider to Vercel for a month and the client will deploy it next month in his own Dockerized infrastructure : if we need more packages in our pipelines / docker / functions, we will add it ourselves.
Now that we have updated ou NextJS 12.3 to Next 13, we are a little afraid that Netlify will take time to fix errors related to functions and edge functions (as well as to fully support Next 13 features, where the features are mainly in these functions).
Thx for your time
TLDR: if you have same issues like missing dependencies in functions, no solutions or answers in this thread
I’m having the same issues with plaiceholder and sharp dependencies on a ISR enabled page.
Here’ some info to help you guys debug:
Deploy ID where I added sharp and plaiceholder as dependencies and it broke the /patch-notes page:
Deploy ID: 6389cd7928d6e60008bece29
I then later disabled ISR for that problematic page and it is working now, however it’d be great to be able to have ISR and still be able to use Plaiceholder on the page. Here’s the corresponding deployId: 6389d94fe4b40d00080e37ed
update: sorry, I didn’t even bother to try adding the above to my netlify.toml. Just tried it now and redeployed. ISR and on-demand static page generation seems to be working now with plaiceholder