eclipse-langium / langium

Next-gen language engineering / DSL framework
https://langium.org/
MIT License
754 stars 68 forks source link

Bug: Get stack overflow error after chevrotain-allstar upgraded to 0.1.5 #997

Closed jiashengguo closed 1 year ago

jiashengguo commented 1 year ago

After chevrotain-allstar upgraded to 0.1.5, when parsing the model file, it will show the below error

An unexpected error occurred:
 RangeError: Maximum call stack size exceeded
    at Object.get [as Terminal] (C:\<my repo path>\node_modules\@chevrotain\gast\lib\src\api.js:6:83)
    at Object.get [as Terminal] (C:\<my repo path>\node_modules\chevrotain-allstar\node_modules\chevrotain\lib\src\api.js:51:97) 
    at atom (C:\<my repo path>\node_modules\chevrotain-allstar\lib\atn.js:105:44)
    at C:\<my repo path>\chevrotain-allstar\lib\atn.js:185:87
    at arrayMap (C:\<my repo path>\node_modules\lodash\_arrayMap.js:16:21)
    at map (C:\<my repo path>\node_modules\lodash\map.js:50:10)
    at block (C:\<my repo path>\node_modules\chevrotain-allstar\lib\atn.js:185:61)
    at atom (C:\<my repo path>\chevrotain-allstar\lib\atn.js:130:16)
    at C:\<my repo path>\chevrotain-allstar\lib\atn.js:185:87
    at arrayMap (C:\<my repo path>\node_modules\lodash\_arrayMap.js:16:21)

Langium version: 1.0.1 Package name: chevrotain-allstar

Steps To Reproduce

  1. git clone https://github.com/jiashengguo/chevrotain-allstart-issue.git
  2. npm install
  3. npm run build

It worked if fix the chevrotain-allstar version to 0.1.4 in package.json.

msujew commented 1 year ago

chevrotain-allstar@0.1.5 fixes a mismatching dependency issue introduced with version 1.1.0 of Langium. We now target chevrotain@~10.4.2 instead of chevrotain@^10.4.2. 0.1.5 of chevrotain-allstar aligned to this version of the chevrotain dependency. Updating to langium@1.1.0 and chevrotain-allstar@0.1.5 resolves the issue. Sorry for the inconvenience.