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

npx zenstack generate doesn't work, maximum call stack errors. #1917

Open
daveycodez opened this issue Dec 17, 2024 · 4 comments
Open

npx zenstack generate doesn't work, maximum call stack errors. #1917

daveycodez opened this issue Dec 17, 2024 · 4 comments

Comments

@daveycodez
Copy link

daveycodez commented Dec 17, 2024

I tried to add ZenStack to my existing NextJS project. It's brand new with create-next-app@latest.

All I do is run these 2 commands and it fails.

npx zenstack@latest init
Installing package "zenstack@2.10.1" with npm

added 121 packages, and audited 856 packages in 5s

200 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
Installing package "@zenstackhq/runtime@2.10.1" with npm

up to date, audited 856 packages in 1s

200 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
Sample model generated at: schema.zmodel

Please check the following guide on how to model your app:
    https://zenstack.dev/#/modeling-your-app.

Project initialized successfully!
npx zenstack generate

An unexpected error occurred:
 RangeError: Maximum call stack size exceeded
    at Rule.get (/Users/david/Developer/new-tech/node_modules/langium/node_modules/@chevrotain/gast/lib/src/model.js:46:23)
    at NonTerminal.get (/Users/david/Developer/new-tech/node_modules/langium/node_modules/@chevrotain/gast/lib/src/model.js:75:44)
    at block (/Users/david/Developer/new-tech/node_modules/chevrotain-allstar/lib/atn.js:185:68)
    at atom (/Users/david/Developer/new-tech/node_modules/chevrotain-allstar/lib/atn.js:130:16)
    at /Users/david/Developer/new-tech/node_modules/chevrotain-allstar/lib/atn.js:185:87
    at arrayMap (/Users/david/Developer/new-tech/node_modules/lodash/_arrayMap.js:16:21)
    at map (/Users/david/Developer/new-tech/node_modules/lodash/map.js:50:10)
    at block (/Users/david/Developer/new-tech/node_modules/chevrotain-allstar/lib/atn.js:185:61)
    at atom (/Users/david/Developer/new-tech/node_modules/chevrotain-allstar/lib/atn.js:130:16)
    at /Users/david/Developer/new-tech/node_modules/chevrotain-allstar/lib/atn.js:185:87

An unexpected error occurred:
 RangeError: Maximum call stack size exceeded
    at Rule.get (/Users/david/Developer/new-tech/node_modules/langium/node_modules/@chevrotain/gast/lib/src/model.js:46:23)
    at NonTerminal.get (/Users/david/Developer/new-tech/node_modules/langium/node_modules/@chevrotain/gast/lib/src/model.js:75:44)
    at block (/Users/david/Developer/new-tech/node_modules/chevrotain-allstar/lib/atn.js:185:68)
    at atom (/Users/david/Developer/new-tech/node_modules/chevrotain-allstar/lib/atn.js:130:16)
    at /Users/david/Developer/new-tech/node_modules/chevrotain-allstar/lib/atn.js:185:87
    at arrayMap (/Users/david/Developer/new-tech/node_modules/lodash/_arrayMap.js:16:21)
    at map (/Users/david/Developer/new-tech/node_modules/lodash/map.js:50:10)
    at block (/Users/david/Developer/new-tech/node_modules/chevrotain-allstar/lib/atn.js:185:61)
    at atom (/Users/david/Developer/new-tech/node_modules/chevrotain-allstar/lib/atn.js:130:16)
    at /Users/david/Developer/new-tech/node_modules/chevrotain-allstar/lib/atn.js:185:87

I'm on macOS if that matters.

@daveycodez daveycodez changed the title npx zenstack generate doesm npx zenstack generate doesn't work, maximum call stack errors. Dec 17, 2024
@daveycodez
Copy link
Author

I did some research and it might be a specific issue with ARM based Macs.

lovell/sharp#3944

Someone had this error only on an arm Mac with Sharp

@ymc9
Copy link
Member

ymc9 commented Dec 19, 2024

HI @daveycodez , could you help check the versions of "langium" and "chevrotain*" in your project? I suspect it's due to a version mismatch.

npm ls langium
npm ls -a | grep chevrotain

@daveycodez
Copy link
Author

npm ls langium
npm ls -a | grep chevrotain
new-tech@0.1.0 /Users/david/Developer/new-tech
└─┬ zenstack@2.10.2
  ├─┬ @zenstackhq/language@2.10.2
  │ └── langium@1.3.1 deduped
  ├─┬ @zenstackhq/sdk@2.10.2
  │ └── langium@1.3.1 deduped
  └── langium@1.3.1

│ │ ├─┬ chevrotain@10.5.0
│ │ │ ├─┬ @chevrotain/cst-dts-gen@10.5.0
│ │ │ │ ├── @chevrotain/gast@10.5.0 deduped
│ │ │ │ ├── @chevrotain/types@10.5.0 deduped
│ │ │ ├─┬ @chevrotain/gast@10.5.0
│ │ │ │ ├── @chevrotain/types@10.5.0 deduped
│ │ │ ├── @chevrotain/types@10.5.0
│ │ │ ├── @chevrotain/utils@10.5.0
│ │ ├─┬ chevrotain-allstar@0.1.7
│ │ │ ├── chevrotain@10.5.0 deduped invalid: "~10.4.1" from node_modules/chevrotain-allstar
│ │ ├─┬ chevrotain@10.4.2
│ │ │ ├─┬ @chevrotain/cst-dts-gen@10.4.2
│ │ │ │ ├── @chevrotain/gast@10.4.2 deduped
│ │ │ │ ├── @chevrotain/types@10.4.2 deduped
│ │ │ ├─┬ @chevrotain/gast@10.4.2
│ │ │ │ ├── @chevrotain/types@10.4.2 deduped
│ │ │ ├── @chevrotain/types@10.4.2
│ │ │ ├── @chevrotain/utils@10.4.2
npm error code ELSPROBLEMS
npm error extraneous: @emnapi/core@0.45.0 /Users/david/Developer/new-tech/node_modules/@emnapi/core
npm error extraneous: @emnapi/runtime@0.45.0 /Users/david/Developer/new-tech/node_modules/@emnapi/runtime
npm error extraneous: @tybys/wasm-util@0.8.3 /Users/david/Developer/new-tech/node_modules/@tybys/wasm-util
npm error extraneous: fs-monkey@1.0.6 /Users/david/Developer/new-tech/node_modules/fs-monkey
npm error extraneous: memfs-browser@3.5.10302 /Users/david/Developer/new-tech/node_modules/memfs-browser
npm error extraneous: memfs@3.5.3 /Users/david/Developer/new-tech/node_modules/memfs
npm error invalid: @types/react@19.0.2 /Users/david/Developer/new-tech/node_modules/@types/react
npm error invalid: chevrotain@10.5.0 /Users/david/Developer/new-tech/node_modules/chevrotain
npm error A complete log of this run can be found in: /Users/david/.npm/_logs/2024-12-20T01_53_11_261Z-debug-0.log

@ymc9
Copy link
Member

ymc9 commented Dec 22, 2024

Thanks for sharing this. It seems there're two versions of chevrotain installed, but I couldn't reproduce the issue locally after installing both. Do you have a sharable repro project?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants