Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dspace-angular 7.6 won't build with Node v20 #2290

Closed
mwoodiupui opened this issue Jun 2, 2023 · 2 comments · Fixed by #2356
Closed

dspace-angular 7.6 won't build with Node v20 #2290

mwoodiupui opened this issue Jun 2, 2023 · 2 comments · Fixed by #2356
Assignees
Labels
bug code task dependencies Pull requests that update a dependency file help wanted Needs a volunteer to claim to move forward high priority port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release

Comments

@mwoodiupui
Copy link
Member

Describe the bug

./server.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
Error: Transform failed with 1 error:
/home/mwood/NetBeansProjects/dspace-angular/src/app/health-page/health-page.component.scss:64:84: ERROR: Unterminated string token

The stylesheet varies; the location is always "64:84", which likely doesn't exist in the named file. Some component of the toolchain has very poor error recovery. There's a Stack post somewhere about this, and it seems that everyone who comes there says none of the previous answers worked but he found a new one that does.

Even when I install nvm and set it to Node v18, I get the same error.

After much trial and error and Googling all over the place: for some reason, webpack was evading nvm and using the system node v20. The css-loader version it wanted was unable to cope, threw up its hands, and some bletcherous piece of code with rotten error recovery somehow turned that into "unterminated string token" at a nonexistent location.

To find this, I had to disable optimization (twice) in angular.json. I then had to raise the "initial" budgets to 13mb/15mb to get to the server build and see the real problem that should have been reported all along. After that I raised the @angular/cli version to 16.0.4 -- the latest. That got me a css-loader that was, not the latest, but late enough not to wig out when running on Node v20.

So, it appears that the minimum we'll need to support building with Node v20 in some future release is:

  • "@angular/cli": "^16.0.4"
  • "eslint-plugin-jsdoc": "^45.0.0" (which I had previously discovered by running yarn install)

(ng version says: "Node: 20.2.0 (Unsupported)" but built it anyway.)

To Reproduce
Steps to reproduce the behavior:

  1. Install Node v20
  2. yarn build:prod

Expected behavior
A clean build as on Node v18.

@mwoodiupui mwoodiupui added bug code task needs triage New issue needs triage and/or scheduling labels Jun 2, 2023
@mwoodiupui
Copy link
Member Author

Those may not be the minimum versions needed, but it does seem to be the minimum set of dependency updates to make building possible.

@tdonohue
Copy link
Member

tdonohue commented Jul 5, 2023

Moving to 8.0 as this is definitely something to work on with that release.

  • Node 16 goes EOL in Sept 2023.
  • Node 18 will remain in support until April 2025.

But, we should work on Node 20 support.

NOTE: Depending on the scope of the changes required, we may also want to backport this to 7.6.x. However, I figure the 8.0 board is the best place for this work to begin.

@tdonohue tdonohue added help wanted Needs a volunteer to claim to move forward dependencies Pull requests that update a dependency file port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release high priority and removed needs triage New issue needs triage and/or scheduling labels Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug code task dependencies Pull requests that update a dependency file help wanted Needs a volunteer to claim to move forward high priority port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants