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

TypeError: Class constructor Generator cannot be invoked without 'new' #56

Closed
illepic opened this issue Oct 22, 2019 · 2 comments
Closed

Comments

@illepic
Copy link

illepic commented Oct 22, 2019

With this simple test:

it('generates a project', () => {
  return helpers
    .run(join(__dirname, '../generators/app'))
    .withPrompts({
      chooseApp: 'app-node-pl',
      patternType: '02-molecules',
      name: 'New Component Test',
    })
    .then(() => {
      console.log('Generator ran');
    });
});

Getting the following error:

TypeError: Class constructor Generator cannot be invoked without 'new'

With this stack:

      at new _class (new-component/generators/app/index.js:30:5)
      at Environment.instantiate (new-component/node_modules/yeoman-environment/lib/environment.js:470:12)
      at Environment.create (new-component/node_modules/yeoman-environment/lib/environment.js:448:17)
      at RunContext.Object.<anonymous>.RunContext._run (new-component/node_modules/yeoman-test/lib/run-context.js:91:29)
      at RunContext.<anonymous> (new-component/node_modules/yeoman-test/lib/run-context.js:59:10)
      at new-component/node_modules/lodash/lodash.js:5118:35
      at new-component/node_modules/yeoman-test/lib/index.js:93:5
      at next (new-component/node_modules/rimraf/rimraf.js:83:7)
      at CB (new-component/node_modules/rimraf/rimraf.js:119:9)
      at new-component/node_modules/rimraf/rimraf.js:145:14

With these deps:

  "dependencies": {
    "gulp-rename": "<=1.2.2",
    "lodash": "^4.17.15",
    "yeoman-generator": "^4.1.0",
    "yeoman-test": "^2.0.0"
  }

Is yeoman-test@^2.0.0 compatible with yeoman-generator@^4.1.0?

@SBoudrias
Copy link
Member

Are you using Babel? This seems like an issue caused by compilation.

@UlisesGascon
Copy link
Member

I agree with @SBoudrias. This seems like a compilation issue

@mshima mshima closed this as completed Feb 2, 2020
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

4 participants