Skip to content

Can't run ng test with @ngtools/webpack 1.3.2 #6457

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
eng-almeida opened this issue May 25, 2017 · 8 comments
Closed

Can't run ng test with @ngtools/webpack 1.3.2 #6457

eng-almeida opened this issue May 25, 2017 · 8 comments

Comments

@eng-almeida
Copy link

eng-almeida commented May 25, 2017

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

                             _                           _  _
  __ _  _ __    __ _  _   _ | |  __ _  _ __         ___ | |(_)
 / _` || '_ \  / _` || | | || | / _` || '__|_____  / __|| || |
| (_| || | | || (_| || |_| || || (_| || |  |_____|| (__ | || |
 \__,_||_| |_| \__, | \__,_||_| \__,_||_|          \___||_||_|
               |___/
@angular/cli: 1.0.0-beta.29
node: 6.10.1
os: darwin x64
@angular/common: 2.4.8
@angular/compiler: 2.4.8
@angular/core: 2.4.8
@angular/forms: 2.4.8
@angular/http: 2.4.8
@angular/platform-browser: 2.4.8
@angular/platform-browser-dynamic: 2.4.8
@angular/router: 3.4.8
@angular/cli: 1.0.0-beta.29
@angular/compiler-cli: 2.4.8

Repro steps.

After doing a clean npm install, run:
ng test --single-run

The log given by the failure.

25 05 2017 15:00:18.993:ERROR [preprocess]: Can not load "webpack"!
  TypeError: Cannot read property 'plugin' of undefined
    at PathsPlugin.apply (/Users/joaoalmeida/MyProj/xxx/node_modules/@ngtools/webpack/src/paths-plugin.js:68:18)
    at Resolver.apply (/Users/joaoalmeida/MyProj/xxx/node_modules/tapable/lib/Tapable.js:306:16)
    at /Users/joaoalmeida/MyProj/xxx/node_modules/enhanced-resolve/lib/ResolverFactory.js:246:12
    at Array.forEach (native)
    at Object.exports.createResolver (/Users/joaoalmeida/MyProj/xxx/node_modules/enhanced-resolve/lib/ResolverFactory.js:245:10)
    at WebpackOptionsApply.process (/Users/joaoalmeida/MyProj/xxx/node_modules/webpack/lib/WebpackOptionsApply.js:282:46)
    at webpack (/Users/joaoalmeida/MyProj/xxx/node_modules/webpack/lib/webpack.js:36:48)
    at new Plugin (/Users/joaoalmeida/MyProj/xxx/node_modules/karma-webpack/lib/karma-webpack.js:63:18)
    at invoke (/Users/joaoalmeida/MyProj/xxx/node_modules/di/lib/injector.js:75:15)
    at Array.instantiate (/Users/joaoalmeida/MyProj/xxx/node_modules/di/lib/injector.js:59:20)
    at get (/Users/joaoalmeida/MyProj/xxx/node_modules/di/lib/injector.js:48:43)
    at /Users/joaoalmeida/MyProj/xxx/node_modules/di/lib/injector.js:71:14
    at Array.map (native)
    at Array.invoke (/Users/joaoalmeida/MyProj/xxx/node_modules/di/lib/injector.js:70:31)
    at Injector.get (/Users/joaoalmeida/MyProj/xxx/node_modules/di/lib/injector.js:48:43)
    at instantiatePreprocessor (/Users/joaoalmeida/MyProj/xxx/node_modules/karma/lib/preprocessor.js:55:20)
    at /Users/joaoalmeida/MyProj/xxx/node_modules/karma/lib/preprocessor.js:106:17
    at Array.forEach (native)
    at /Users/joaoalmeida/MyProj/xxx/node_modules/karma/lib/preprocessor.js:103:27
    at module.exports (/Users/joaoalmeida/MyProj/xxx/node_modules/karma/node_modules/isbinaryfile/index.js:28:12)
    at /Users/joaoalmeida/MyProj/xxx/node_modules/karma/lib/preprocessor.js:84:7
    at /Users/joaoalmeida/MyProj/xxx/node_modules/graceful-fs/graceful-fs.js:78:16
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:446:3)
25 05 2017 15:00:19.032:INFO [karma]: Karma v1.2.0 server started at http://localhost:9876/
25 05 2017 15:00:19.032:INFO [launcher]: Launching browser Chrome with unlimited concurrency
25 05 2017 15:00:19.033:ERROR [karma]: Found 1 load error

Desired functionality.

Should run unit tests

Mention any other details that might be useful.

I believe this issue might be related to the last updated on ngtools/webpack . Specifically from version 1.3.1 to 1.3.2.

Package.json from my project

{
  "name": "###",
  "version": "0.0.1",
  "license": "MIT",
  "angular-cli": {},
  "scripts": {
    "start": "ng serve",
    "lint": "tslint \"src/**/*.ts\"",
    "test": "ng test",
    "pree2e": "webdriver-manager update",
    "e2e": "protractor"
  },
  "private": true,
  "dependencies": {
    "@angular/common": "2.4.8",
    "@angular/compiler": "2.4.8",
    "@angular/core": "2.4.8",
    "@angular/forms": "2.4.8",
    "@angular/http": "2.4.8",
    "@angular/platform-browser": "2.4.8",
    "@angular/platform-browser-dynamic": "2.4.8",
    "@angular/router": "3.4.8",
    "@ngrx/core": "1.2.0",
    "@ngrx/effects": "2.0.0",
    "@ngrx/store": "2.2.1",
    "@ngrx/store-devtools": "3.2.2",
    "angular2-recaptcha": "^0.3.7",
    "angular2-text-mask": "^4.1.0",
    "bulma": "0.2.3",
    "core-js": "2.4.1",
    "ng2-file-upload": "1.2.0",
    "ng2-translate": "5.0.0",
    "oidc-token-manager": "1.2.0",
    "rxjs": "5.0.3",
    "ts-helpers": "1.1.2",
    "typescript": "2.0.10",
    "web-animations-js": "2.2.2",
    "zone.js": "0.7.2"
  },
  "devDependencies": {
    "@angular/cli": "1.0.0-beta.29",
    "@angular/compiler-cli": "2.4.8",
    "@types/chai": "3.4.34",
    "@types/isomorphic-fetch": "0.0.32",
    "@types/jasmine": "2.5.41",
    "@types/node": "7.0.3",
    "azure-storage": "1.3.2",
    "codelyzer": "2.0.0-beta.4",
    "faker": "^4.1.0",
    "jasmine-core": "2.4.1",
    "jasmine-reporters": "^2.2.0",
    "jasmine-spec-reporter": "2.5.0",
    "karma": "1.2.0",
    "karma-chrome-launcher": "2.0.0",
    "karma-cli": "1.0.1",
    "karma-coverage": "1.1.1",
    "karma-jasmine": "1.0.2",
    "karma-remap-istanbul": "0.2.1",
    "karma-teamcity-reporter": "1.0.0",
    "node-sass": "3.7.0",
    "protractor": "5.1.0",
    "react": "15.4.2",
    "react-redux": "5.0.2",
    "redux": "3.6.0",
    "redux-devtools": "3.3.2",
    "remap-istanbul": "0.6.4",
    "string-replace-loader": "1.0.3",
    "ts-node": "1.2.1",
    "tslint": "4.3.1",
    "webdriver-manager": "10.2.5",
    "webpack": "~2.2.1"
  }
}
@onuralps
Copy link

Same problem here

@ashfaqch
Copy link

ashfaqch commented May 25, 2017

I am having same issue since this morning!

angular-cli: 1.0.0-beta.26

@smileLilith
Copy link

smileLilith commented May 25, 2017

+1 since yesterday and upgrading from angular-cli v1.0.0-beta.30 to v1.0.6
added missing tsconfig.spec.ts has solved issue

@onuralps
Copy link

onuralps commented May 26, 2017

for me adding "@ ngtools/webpack": "1.3.0" to package.json solved the issue for now but i am not an expert and do not know if there is any side effect.

@eng-almeida
Copy link
Author

@smileLilith what do you mean adding tsconfig.spec.ts? Can you be more specific, providing an example? @onuralps I also did that (in my case was ngtools/webpack 1.3.1) has a temporary solution. I think we should not override ngtools/webpack, otherwise we may face new problems on future releases from angular-cli.

@eng-almeida
Copy link
Author

This PR with a revert commit fixed the problem #6463
Thanks @hansl

@hansl
Copy link
Contributor

hansl commented Feb 6, 2018

Closing this as obsolete/fixed.

@hansl hansl closed this as completed Feb 6, 2018
@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 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants