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

Upgrade to Node 18 #20199

Closed
wants to merge 5 commits into from
Closed

Upgrade to Node 18 #20199

wants to merge 5 commits into from

Conversation

mraible
Copy link
Contributor

@mraible mraible commented Nov 4, 2022

Please make sure the below checklist is followed for Pull Requests.

@mraible mraible mentioned this pull request Nov 4, 2022
6 tasks
@mraible
Copy link
Contributor Author

mraible commented Nov 6, 2022

@mshima Can you please review?

@mshima
Copy link
Member

mshima commented Nov 6, 2022

What problem this PR tries to fix?
Those dependencies doesn’t look to be used directly. If they are transitive dependency they shouldn’t be added as a direct dependency.

@mraible
Copy link
Contributor Author

mraible commented Nov 7, 2022

If I create a microservices architecture with jhipster jdl reactive-ms, these errors happen when I start the gateway app.

@mraible
Copy link
Contributor Author

mraible commented Nov 8, 2022

@mshima Do you see errors when you run jhipster jdl reactive-ms with the Spring Boot 3 branch and start the gateway app? If not, maybe it's my machine or Node/npm versions.

  • node: v16.17.0
  • npm: 8.19.3

I just tried again and I'm still able to reproduce it.

[webpack-cli] Failed to load '/Users/mraible/Downloads/reactive-ms2/gateway/webpack/webpack.common.js' config
[webpack-cli] Error: Cannot find module 'ajv/dist/compile/codegen'

@mshima
Copy link
Member

mshima commented Nov 9, 2022

@mraible I’ve tried to reproduce with main.
I don’t see a reason for it work at main and fail at sb3 branch. Sb3 almost doesn’t change client side.
npm start works correctly.
./gradlew fails. I’ve managed to make it work by updating vue-template-compiler to latest 2.7.
But updating vue to latest 2.7 fails with vuejs/vue#12750.
I tried to migrate to vuelidate 2 but didn’t succeed.
We will probably need to migrate to composing-api https://vuelidate-next.netlify.app/#getting-started-1, dropping property decorator and vue-class-component.

@mraible
Copy link
Contributor Author

mraible commented Nov 9, 2022

@mshima It fails for me with v7.9.3 too.

@mshima
Copy link
Member

mshima commented Nov 9, 2022

@mraible what command are you using to start the frontend?

@mraible
Copy link
Contributor Author

mraible commented Nov 9, 2022

@mshima

jhipster jdl reactive-ms
cd gateway
./gradlew

@mshima
Copy link
Member

mshima commented Nov 9, 2022

@mraible just generated a new application using v7.9.3:

npx generator-jhipster@7.9.3 jdl reactive-ms
cd gateway
./gradlew

It works:

> webpack --config webpack/webpack.common.js --mode development --env stats=minimal

assets by info 4.37 MiB [immutable]
  assets by path app/*.js 4.36 MiB 24 assets
  assets by chunk 12.5 KiB (auxiliary name: app)
    asset c0285e5e9ebdce9056be.svg 11.9 KiB [emitted] [immutable] [from: src/main/webapp/content/images/jhipster_family_member_0.svg] (auxiliary name: app)
    asset cfd81fbabebba3d187b7.png 605 bytes [emitted] [immutable] [from: src/main/webapp/content/images/logo-jhipster.png] (auxiliary name: app)
assets by path content/ 444 KiB 25 assets
assets by path swagger-ui/ 3.09 MiB 16 assets
asset ./i18n/en.json 14 KiB [emitted]
asset index.html 5.78 KiB [emitted]
asset favicon.ico 1.54 KiB [emitted] [from: src/main/webapp/favicon.ico] [copied]
asset manifest.webapp 749 bytes [emitted] [from: src/main/webapp/manifest.webapp] [copied]
asset robots.txt 145 bytes [emitted] [from: src/main/webapp/robots.txt] [copied]
orphan modules 786 KiB [orphan] 185 modules
runtime modules 8.82 KiB 10 modules
javascript modules 3.51 MiB
  modules by path ./node_modules/ 2.23 MiB 267 modules
  modules by path ./src/main/webapp/ 1.28 MiB
    modules by path ./src/main/webapp/app/ 544 KiB 190 modules
    modules by path ./src/main/webapp/content/scss/*.scss 762 KiB
      ./src/main/webapp/content/scss/global.scss 1.64 KiB [built] [code generated]
      ./src/main/webapp/content/scss/vendor.scss 1.64 KiB [built] [code generated]
      ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-7.use[1]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-7.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-7.use[3]!./src/main/webapp/content/scss/global.scss 15.2 KiB [built] [code generated]
      ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-7.use[1]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-7.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-7.use[3]!./src/main/webapp/content/scss/vendor.scss 743 KiB [built] [code generated]
asset modules 84 bytes (javascript) 12.5 KiB (asset)
  ./src/main/webapp/content/images/jhipster_family_member_0.svg 42 bytes (javascript) 11.9 KiB (asset) [built] [code generated]
  ./src/main/webapp/content/images/logo-jhipster.png 42 bytes (javascript) 605 bytes (asset) [built] [code generated]
webpack 5.74.0 compiled successfully in 4316 ms

Main is failing with:

> Task :compileJava
Note: Hibernate JPA 2 Static-Metamodel Generator 5.6.10.Final
/Users/mshima/aplicacoes/reactive-ms/gateway/src/main/java/com/okta/developer/gateway/repository/rowmapper/ColumnConverter.java:10: error: cannot find symbol
import tech.jhipster.service.ColumnConverterReactive;
                            ^
  symbol:   class ColumnConverterReactive
  location: package tech.jhipster.service
/Users/mshima/aplicacoes/reactive-ms/gateway/src/main/java/com/okta/developer/gateway/repository/rowmapper/ColumnConverter.java:16: error: cannot find symbol
public class ColumnConverter implements ColumnConverterReactive {
                                        ^
  symbol: class ColumnConverterReactive
2 errors

@mraible
Copy link
Contributor Author

mraible commented Nov 9, 2022

That's so strange. Any idea why it fails on my machine? I'm using an M1.

@mshima
Copy link
Member

mshima commented Nov 9, 2022

That's so strange. Any idea why it fails on my machine? I'm using an M1.

I don't known. Using M1 too
It's recently generated?
Maybe cleanup:

rm -rf build
rm -rf node_modules
./gradlew

@mraible
Copy link
Contributor Author

mraible commented Nov 9, 2022

Yes, I just generated it this morning, which means it's clean aside from what the jdl command does. If I do jhipster jdl reactive-ms --skip-install, it still fails for me.

I also tried clearing the npm cache and deleting ~/.m2/repository. It didn't help.

I'm using nvm. Maybe that's the problem?

@mshima
Copy link
Member

mshima commented Nov 9, 2022

I've fixed the local ColumnConverterReactive error and the gateway started correctly using main:

----------------------------------------------------------
        Application 'gateway' is running! Access URLs:
        Local:          http://localhost:8080/
        External:       http://127.0.0.1:8080/
        Profile(s):     [dev, api-docs]
----------------------------------------------------------

production started correctly too:

----------------------------------------------------------
        Application 'gateway' is running! Access URLs:
        Local:          http://localhost:8080/
        External:       http://127.0.0.1:8080/
        Profile(s):     [prod]
----------------------------------------------------------

@mshima
Copy link
Member

mshima commented Nov 9, 2022

Do you have a .npmrc file?
Somewhere?
Looks related to an old issue using legacy-peer-deps config: ajv-validator/ajv-formats#15

@mraible mraible changed the title Upgrade to Node 18 and fix npm install errors Upgrade to Node 18 Nov 10, 2022
@mraible
Copy link
Contributor Author

mraible commented Nov 10, 2022

Do you have a .npmrc file?

That was it! I had one in my home directory.

@mraible
Copy link
Contributor Author

mraible commented Nov 11, 2022

Closing because this PR is messed up.

@mraible mraible closed this Nov 11, 2022
@mraible mraible deleted the node-18-npm-fixes branch November 15, 2022 01:09
@DanielFran DanielFran added this to the 8.0.0-beta.1 milestone Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants