Skip to content

ng test --lint results in "Module build failed: TypeError: Linter is not a constructor" #3461

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

Closed
JohannesRudolph opened this issue Dec 8, 2016 · 3 comments

Comments

@JohannesRudolph
Copy link
Contributor

JohannesRudolph commented Dec 8, 2016

Please provide us with the following information:

OS?

OS X El Cap

Versions.

angular-cli: 1.0.0-beta.22-1
node: 6.9.1
os: darwin x64

Repro steps.

Run ng test --lint

The log given by the failure.

iDevBook01:console jr$ ng test --lint

08 12 2016 07:25:03.034:WARN [karma]: No captured browser, open http://localhost:9876/

ERROR in ./src/test.ts
Module build failed: TypeError: Linter is not a constructor
    at Object.lint (/Users/jr/dev/console/console/node_modules/tslint-loader/index.js:40:16)
    at Object.module.exports (/Users/jr/dev/console/console/node_modules/tslint-loader/index.js:103:8)
08 12 2016 07:25:03.045:INFO [karma]: Karma v1.2.0 server started at http://localhost:9876/
08 12 2016 07:25:03.045:INFO [launcher]: Launching browser Chrome with unlimited concurrency
08 12 2016 07:25:03.080:INFO [launcher]: Starting browser Chrome
08 12 2016 07:25:04.799:INFO [Chrome 54.0.2840 (Mac OS X 10.11.6)]: Connected on socket /#1TmyXeQs7WSWHxlAAAAA with id 64795253
08 12 2016 07:25:04.952:WARN [reporter]: SourceMap position not found for trace: undefined
08 12 2016 07:25:04.953:WARN [reporter]: SourceMap position not found for trace: undefined
Chrome 54.0.2840 (Mac OS X 10.11.6) ERROR
  Uncaught Error: Module build failed: TypeError: Linter is not a constructor
      at Object.lint (/Users/jr/dev/console/console/node_modules/tslint-loader/index.js:40:16)
      at Object.module.exports (/Users/jr/dev/console/console/node_modules/tslint-loader/index.js:103:8)
  at src/test.ts:71


Module build failed: TypeError: Linter is not a constructor

Mention any other details that might be useful.

I'm using yarn and have performed a clean re-install of angular-cli (yarn remove && yarn add) for the upgrade from .beta-21 to .beta-22 so that all indirect dependencies are on their latest version as well. However, running a yarn check (checks the integrity of all specified version dependencies) yields this error:

iDevBook01:console jr$ yarn check
yarn check v0.17.10
error angular-cli#tslint-loader#tslint@^3.0.0 doesn't satisfy found match of [email protected]
warning chokidar#fsevents#node-pre-gyp@^0.6.29 could be deduped from 0.6.31 to [email protected]
error Found 1 errors.
info Visit https://yarnpkg.com/en/docs/cli/check for documentation about this command.

So it seems angular-cli maybe needs an upgrade of tslint-loader in its package.json?

@JohannesRudolph
Copy link
Contributor Author

Did some more digging, it appears tslint-loader resolves to version 2.1.5 for me (angular-cli's package.json specifies ^2.1.4, which has the following package.json:

  "name": "tslint-loader",
  "version": "2.1.5",
...
  "peerDependencies": {
    "tslint": "^3.0.0"
  },
}

So looks like we need an update of tslint-loader (its 3.x series supports tslint 4.0). So I have done a yarn add tslint-loader --dev and alas, my issue is fixed and ng test --lint works as it should.

JohannesRudolph added a commit to JohannesRudolph/angular-cli that referenced this issue Dec 8, 2016
@Juansasa
Copy link

Juansasa commented Dec 8, 2016

Same problem with UNMET tslint dependency addressed in #3453

MRHarrison pushed a commit to MRHarrison/angular-cli that referenced this issue Feb 9, 2017
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants