Site deploy fail

@coelmay Has provided the specific answer that you would need to get it running, but I’ll help you interpret the errors you’re seeing, in particular from the change you made:

3:07:36 PM: npm ERR! ERESOLVE unable to resolve dependency tree

This is still a dependency error.

3:07:36 PM: npm ERR! Found: webpack@4.46.0
3:07:36 PM: npm ERR! node_modules/webpack
3:07:36 PM: npm ERR! dev webpack@"^4.0.0" from the root project

You’ve changed the root of the project to use Webpack 4.

3:07:36 PM: npm ERR! Could not resolve dependency:
3:07:36 PM: npm ERR! peer webpack@"^5.0.0" from html-loader@2.1.2

The html-loader dependency wants Webpack 5.

So despite the change, the problem remains the same, some dependencies want Webpack 4 and some want Webpack 5.

It’s a build issue that you can fix by adjusting the dependencies to use versions that all utilise the same version of Webpack (if they exist), or as indicated you can use the npm flags to try and get past the issue.

When the build is running on Netlify, they execute npm install for you.
To pass the npm flags you use the NPM_FLAGS environment variable demonstrated by @coelmay.


Summary:

  • Edit your package.json back from "webpack": "^4.0.0", to "webpack": "^5.40.0",.

  • Add the Environment variable of NPM_FLAGS with a value of --legacy-peer-deps into Netlify.

  • Rebuild

3 Likes