filestash icon indicating copy to clipboard operation
filestash copied to clipboard

[bug] cannot build with current node version

Open qwerty287 opened this issue 2 years ago • 3 comments

Description of the bug

I can't build the frontend with a current node version (node v18.7.0 with npm 8.15.1).

Step by step instructions to reproduce the bug

Install or update to node 18 and try to run npm install.

Can you replicate that error from the demo?

No, because I don't compile it there.

Observed behavior

  1. Running npm install fails due to peer dependency issues. I solved this by using npm install --force
  2. Using this fails at another point, when node-sass is compiled. This is an issue of node-sass with the current node version. You should migrate to dart-sass (NPM package sass). I tried to migrate this, and I also tried to update various dependencies (you should update webpack to v5), but it fails. I didn't investigated here that much.

Expected behavior

It runs without errors, similar to what the CI does. The CI uses node 13, which is end of life for 2 years now. You should update this project and the package.json files / dependencies to be compatible with all currently supported Node/NPM versions (as of writing this, these are 14, 16 and 18).

qwerty287 avatar Aug 01 '22 10:08 qwerty287

I noticed this as well. To get it working I used https://github.com/nodenv/nodenv (which is excellent) to set the environment to Node 13. This resulted in a successful build without too many issues if I remember correctly. npm install --force didn't work for me.

Node Sass is a real pain, I will say that. Seeing as updating everything to the latest versions didn't work it is possible that one of the packages is not being maintained any more which might take some time to fix/replace. @qwerty287 were you able to isolate the issue any more than when you created this issue? I might get some time to have a look this week :crossed_fingers:

JoshuaCrewe avatar Aug 02 '22 08:08 JoshuaCrewe

Not really. The first issue is Node-Sass, if I try to replace it with Dart-Sass it fails when trying to build node-gyp. I was able to successfully run npm install --force by updating every dev dependency to its latest version, but it fails obviously when trying to build the frontend because of breaking changes. I'd suggest you to try to update the dev dependencies at all and to move to Dart-Sass instead of Node-Sass. Upgrading Webpack to v5 could have been the issue, but this I couldn't find out so far. You have to update the webpack.config.js to follow the newer guidelines at all (Webpack has some docs about is, but the only contain guides for upgrading from v3 -> v4 and v4 -> v5 but nothing from v2 what Filestash is using).

qwerty287 avatar Aug 02 '22 08:08 qwerty287

beautiful. Thanks for the guidance. I will take a look and see how far we can get.

JoshuaCrewe avatar Aug 02 '22 08:08 JoshuaCrewe

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 01 '22 11:10 stale[bot]

This is still not fixed.

qwerty287 avatar Oct 01 '22 12:10 qwerty287

Stalebot is super keen. It was too much for me to see this one through at the moment. Probably should get done one day but it isn't a super fun one to do so I understand why it wouldn't!

JoshuaCrewe avatar Oct 01 '22 18:10 JoshuaCrewe

I was able to compile with actual at least supported images from node 14 and golang 18. But i just build from Dockerfile didn't test drone CI build. Also node dependencies should update asap. npm output say found 39 vulnerabilities (18 moderate, 20 high, 1 critical)

telsch avatar Oct 25 '22 19:10 telsch

being able to create a build against every possible node version isn't really in the roadmap, there's only so much I can do on my own. If someone wants to see which version works, we've complete the migration of CI to github action so you can use that as a reference

mickael-kerjean avatar Mar 30 '23 14:03 mickael-kerjean