question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

runtime exception: `Class constructor GAstVisitor cannot be invoked without 'new'`

See original GitHub issue
ERROR! Class constructor GAstVisitor cannot be invoked without 'new'
TypeError: Class constructor GAstVisitor cannot be invoked without 'new'
    at new DslMethodsCollectorVisitor (/Users/mshima/aplicacoes/default/node_modules/chevrotain/lib/src/parse/parser/traits/looksahead.js:107:47)
    at Object.<anonymous> (/Users/mshima/aplicacoes/default/node_modules/chevrotain/lib/src/parse/parser/traits/looksahead.js:148:24)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/Users/mshima/aplicacoes/default/node_modules/chevrotain/lib/src/parse/parser/parser.js:34:20)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)

Reproducing:

npx generator-jhipster@latest jdl bug-tracker.jh

Related to https://github.com/jhipster/generator-jhipster/pull/19483

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
bd82commented, Aug 20, 2022

Okay I realize why 6months old version 10.1.2 suddenly broke in generator-jhipster

Basically chevrotain 10.1.2 was depending on @chevrotain/gast ^10.1.2 (with ^ minor range). So once chevrotain 10.2.0 was released installing chevrotain@10.1.2 would pull @chevrotain/gast@10.2.0 as a dependency, but between these two versions the TypeScript compilation target changed (es5 --> ES2015) so the inheritance system is incompatible between these two versions.

There are a few solutions:

  1. add a shrinkwrap file to generator-jhipster
  2. release 10.2.1 version of chevrotain with the es5 compilation target and then release version 11.0.0 with the new compilation target.

I will try to implement #2 but if you can’t wait you may want to implement the first one.

I still don’t know why you encountered issues with 10.2.0…

1reaction
bd82commented, Aug 22, 2022

hip hip hurray 😸

Read more comments on GitHub >

github_iconTop Results From Across the Web

Class constructor cannot be invoked without 'new' in TS
The "Class constructor cannot be invoked without new" error occurs when the target property in tsconfig.json is set to lower than es6 or...
Read more >
Javascript ES6 TypeError: Class constructor Client cannot be ...
When I try to execute nodemon command I always see this error TypeError: Class constructor Client cannot be invoked without 'new'.
Read more >
`TypeError: Class constructor cannot be invoked without 'new ...
Bug report Getting the following error in my project: TypeError: Class constructor cannot be invoked without 'new' Looking at some related ...
Read more >
RuntimeException (Java Platform SE 7 ) - Oracle Help Center
public class RuntimeException extends Exception ... Unchecked exceptions do not need to be declared in a method or constructor's throws clause if they...
Read more >
changes/CHANGELOG.md - Chevrotain
runtime exception : Class constructor GAstVisitor cannot be invoked without ... The CST creation no longer relies on "new Function()" calls and can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found