Hi all,
I’m having a problem with deployment on Netlify. I’m trying to deploy a branch that uses useSWR. In the first deployment, it built and worked as expected. However, in the builds that followed, it started to crash. Even when retriggering the original build that worked, it now crashes.
The error that I’m specifically getting is the following:
I’m unable to replicate the error locally, and I have no clue why this is happening. Here’s some information about my project;
Next.js 12.0.10
React/React-DOM 17.0.2
SWR 1.2.1
If you can provide any help, I would really appreciate it. I can also provide any other necessary information needed.
Thanks!
Hey there, @p0w3r_zurg3
Thanks for reaching out! Can you share your full deploy log as well as your package.json?
Hi Hillary!
I came across this post, which seems to have solved it.
Hi,
I recently tried to update to nextjs12 and react18 to see if there would be any problems upgrading and I’ve run into some problems deploying to Netlify. Everything works great locally, but the deploy fails because it thinks React does not include useRef from Jotai library.
Has anyone run into similar issues and know what you can do to resolve these issues?
next.config
// next.config.js
const withTM = require('next-transpile-modules')(['@personal-component-library']);
module.exports = w…
Adding the following text to netlify.toml did the trick for me as well;
[build.environment]
NODE_VERSION = "14"
Thanks!
Hey there, @p0w3r_zurg3
Glad to hear everything is working now! Thanks for letting us know. Happy building