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

[v7] node v18 test #20394

Closed
wants to merge 4 commits into from
Closed

Conversation

mshima
Copy link
Member

@mshima mshima commented Nov 18, 2022

Not to be merged, this PR tests v7 branch with node 18

Related to #20349.


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

When you are still working on the PR, consider converting it to Draft (below reviewers) and adding skip-ci label, you can still see CI build result at your branch.

@mraible
Copy link
Contributor

mraible commented Jan 19, 2023

@mshima What do we need to do to make the main branch work with Node 18?

Related: we should probably do a 7.x release that works with Node 18.

@mshima
Copy link
Member Author

mshima commented Jan 20, 2023

@mraible main is supposed to work with node 18, only a wait-on (actually node) bug that requires to use the loopback ip instead of localhost name (in case ipv6 is preferred).

@mraible
Copy link
Contributor

mraible commented Jan 20, 2023

We might want to release a new 7.9.x version that works with Node 18, since a lot of folks seem to be running into this issue.

@mraible
Copy link
Contributor

mraible commented Feb 1, 2023

I just tried installing version 7.9.3 and using Node v18.13.0. It does not work:

$ jhipster
INFO! Using bundled JHipster
node:internal/modules/cjs/loader:544
      throw e;
      ^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/util/namespace' is not defined by "exports" in /Users/mraible/.nvm/versions/node/v18.13.0/lib/node_modules/generator-jhipster/node_modules/yeoman-environment/package.json
    at new NodeError (node:internal/errors:400:5)
    at exportsNotFound (node:internal/modules/esm/resolve:361:10)
    at packageExportsResolve (node:internal/modules/esm/resolve:697:9)
    at resolveExports (node:internal/modules/cjs/loader:538:36)
    at Module._findPath (node:internal/modules/cjs/loader:607:31)
    at Module._resolveFilename (node:internal/modules/cjs/loader:1025:27)
    at Module._load (node:internal/modules/cjs/loader:885:27)
    at Module.require (node:internal/modules/cjs/loader:1105:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.<anonymous> (/Users/mraible/.nvm/versions/node/v18.13.0/lib/node_modules/generator-jhipster/utils/blueprint.js:19:25) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

This fix solved it for me.

@mraible
Copy link
Contributor

mraible commented Feb 1, 2023

Maybe I spoke too soon. Both on Node v16.19.0 and with v18.13.0 (after the fix), the following happens:

✖ An error occured while running jhipster:languages#writeClientTranslations
ERROR! Template file src/main/webapp/i18n/id/error.json was not found at /Users/mraible/.nvm/versions/node/v16.19.0/lib/node_modules/generator-jhipster/generators/languages/templates
Error: Template file src/main/webapp/i18n/id/error.json was not found at /Users/mraible/.nvm/versions/node/v16.19.0/lib/node_modules/generator-jhipster/generators/languages/templates
    at renderTemplate (/Users/mraible/.nvm/versions/node/v16.19.0/lib/node_modules/generator-jhipster/generators/generator-base.js:2521:17)
    at /Users/mraible/.nvm/versions/node/v16.19.0/lib/node_modules/generator-jhipster/generators/generator-base.js:2681:69
    at Array.map (<anonymous>)
    at module.exports.writeFiles (/Users/mraible/.nvm/versions/node/v16.19.0/lib/node_modules/generator-jhipster/generators/generator-base.js:2681:53)
    at module.exports.writeClientTranslations (/Users/mraible/.nvm/versions/node/v16.19.0/lib/node_modules/generator-jhipster/generators/languages/index.js:256:22)

This could certainly be my machine only, not sure.

@mshima
Copy link
Member Author

mshima commented Feb 1, 2023

jhipster v7.9.3 is broken at node 18, fixed at jhipster:v7.x_maintenance branch.
Should install from git.

@mraible
Copy link
Contributor

mraible commented Feb 1, 2023

@mshima I'm saying v7.9.3 seems to be broken with Node 16 too. I have successfully used it with Node 16 before, so it certainly could be my machine. I just tried it with v16.19.0 and v16.17.1. Both result in the error above.

An error occured while running jhipster:languages#writeClientTranslations

If I try npm i -g "https://github.com/jhipster/generator-jhipster#v7.x_maintenance", the problem still happens.

@mraible
Copy link
Contributor

mraible commented Feb 1, 2023

Nevermind, these failures are happening because I'm using the ng-default/.yo-rc.json file from the main branch to test things and that won't work with older versions of JHipster because there's different languages in it.

@mshima
Copy link
Member Author

mshima commented Mar 30, 2023

jhipster v7 at maintenance branch works with node 18, except the broken by #21380

@mshima mshima closed this Mar 30, 2023
@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.

3 participants