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

Generator error on Node 20.6.0 #23417

Closed
deepu105 opened this issue Sep 5, 2023 · 3 comments · Fixed by #23849
Closed

Generator error on Node 20.6.0 #23417

deepu105 opened this issue Sep 5, 2023 · 3 comments · Fixed by #23849
Labels
area: bug 🐛 javascript Pull requests that update Javascript code
Milestone

Comments

@deepu105
Copy link
Member

deepu105 commented Sep 5, 2023

On Node.js v20.6.0 Generator is throwing the following error. This affects the v8.0.0-beta.3 and main branch

ERROR! An error occured while running jhipster:app#compose
ERROR! ERROR! common.register is not a function
TypeError: common.register is not a function
    at Object.<anonymous> (/home/deepu/.nvm/versions/node/v20.6.0/lib/node_modules/generator-jhipster/node_modules/shelljs/src/cat.js:4:8)
    at Module._compile (node:internal/modules/cjs/loader:1241:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
    at Module.load (node:internal/modules/cjs/loader:1091:32)
    at Module._load (node:internal/modules/cjs/loader:938:12)
    at Module.require (node:internal/modules/cjs/loader:1115:19)
    at require (node:internal/modules/helpers:130:18)
    at /home/deepu/.nvm/versions/node/v20.6.0/lib/node_modules/generator-jhipster/node_modules/shelljs/shell.js:25:3
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (/home/deepu/.nvm/versions/node/v20.6.0/lib/node_modules/generator-jhipster/node_modules/shelljs/shell.js:24:23)
(node:341665) Warning: Accessing non-existent property 'register' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
ERROR! Unhandled promise rejection at:
FATAL! TypeError: common.register is not a function
@mshima
Copy link
Member

mshima commented Sep 6, 2023

Workaround is to downgrade to v20.5.1.

Dropping shelljs another error appears:

ERROR! ERROR! Cannot set property Argument of #<Object> which has only a getter
TypeError: Cannot set property Argument of #<Object> which has only a getter
    at Object.<anonymous> (/Users/mshima/git/generator-jhipster/node_modules/dockerfile-ast/lib/main.js:3:637)
    at Module._compile (node:internal/modules/cjs/loader:1241:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)

@mshima mshima changed the title Generator error on Node 20.6 Generator error on Node 20.6.0 Sep 6, 2023
@deepu105
Copy link
Member Author

deepu105 commented Sep 7, 2023 via email

@hide212131
Copy link
Contributor

I can confirm that the code can be generated with the bug fixed v20.6.1.

deepu105 added a commit to deepu105/generator-jhipster that referenced this issue Oct 14, 2023
mshima pushed a commit that referenced this issue Oct 14, 2023
@deepu105 deepu105 added this to the 8.0.0 milestone Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: bug 🐛 javascript Pull requests that update Javascript code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants