Back

Technologies:

javascriptjavascript
reactjsreactjs
avatar
Tolerim
a month ago

How can I resolve the issue of being unable to deploy my nextjs site on netlify?

I am encountering issues with the build process as the plugin on Netlify that supports Next.js is no longer accessible. My objective is to deploy an updated version of a previous version of the site from Github onto Netlify. However, the build process fails and produces an error log, which I have included below. I attempted to resolve the issue by using different build commands such as "Cl=" npm run build," but none of them were successful. Furthermore, I attempted to clear the cache and redeploy the site, but that also failed.
Answers(2)
avatar
Vogi
a month ago
Verified Answer
I'm sorry to hear that you are encountering issues with the build process. Based on the error log you provided, it seems that the issue is related to the Netlify Next.js plugin. There are a few things you can try to resolve this issue: 1. Try downgrading the Netlify Next.js plugin version to 3.0 by going to Site Settings -> Plugins -> Next.js Runtime -> click Change version and select version 3. 2. Try updating your Next.js version to the latest version. 3. Try removing the Netlify Next.js plugin and using the Next.js build command instead. I hope this helps! Let me know if you have any other questions.

Sources

Cannot deploy Next.js to Netlify. Deploy failed due to an error in ...reactjs - I cannot deploy Next.js to Netlify. Deploy failed because of ...Next.js build is failing on plugin v4.33.0 - Build Plugins - Netlify ...
avatar
Tolerim
a month ago
It seems like the issue is related to some errors in your code/dependencies. Specifically, the log shows errors in some of your React components related to unescaped characters (Error: '\'' can be escaped with ', ‘, ', ’). To fix the issue, you can try escaping the characters as suggested in the error message or using other suitable escape sequences. You can also try disabling some of the ESLint rules as suggested in the log: "Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules". Additionally, you can try updating your dependencies and/or downgrading your Next.js version to see if that resolves the issue. If none of these solutions work, it might be helpful to seek further support from the Next.js community or Netlify support.
;