angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Can't serve due to uglifyjs-webpack-plugin 1.1.7 release

Open admosity opened this issue 8 years ago • 22 comments

Versions

Angular CLI: 1.6.5
Node: 8.7.0
OS: darwin x64
Angular: 5.2.1
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cdk: 2.0.0-beta.12
@angular/cli: 1.6.5
@angular-devkit/build-optimizer: 0.0.41
@angular-devkit/core: 0.0.28
@angular-devkit/schematics: 0.0.51
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.5
@schematics/angular: 0.1.16
typescript: 2.5.3
webpack: 3.10.0

Repro steps

  • ng new project
  • ng serve
  • npm run start - does the same thing

Observed behavior

> npm run start

> [email protected] start /u/admosity/git/_personal/lerna-repo/packages/client1
> ng serve

Cannot find module 'uglifyjs-webpack-plugin'
Error: Cannot find module 'uglifyjs-webpack-plugin'
    at Function.Module._resolveFilename (module.js:527:15)
    at Function.Module._load (module.js:476:23)
    at Module.require (module.js:568:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/u/admosity/git/_personal/lerna-repo/packages/client1/node_modules/@angular/cli/models/webpack-configs/production.js:13:24)
    at Module._compile (module.js:624:30)
    at Object.Module._extensions..js (module.js:635:10)
    at Module.load (module.js:545:32)
    at tryModuleLoad (module.js:508:12)
    at Function.Module._load (module.js:500:3)
    at Module.require (module.js:568:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/u/admosity/git/_personal/lerna-repo/packages/client1/node_modules/@angular/cli/models/webpack-configs/index.js:9:10)
    at Module._compile (module.js:624:30)
    at Object.Module._extensions..js (module.js:635:10)
    at Module.load (module.js:545:32)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `ng serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /u/admosity/.npm/_logs/2018-01-29T19_50_52_816Z-debug.log

Desired behavior

Project should run

Mention any other details that might be useful (optional)

webpack-contrib/uglifyjs-webpack-plugin#217

admosity avatar Jan 29 '18 20:01 admosity

I can confirm same issue.

seekheart avatar Jan 29 '18 20:01 seekheart

Getting the same issue.

philljones avatar Jan 29 '18 20:01 philljones

+1

davishd avatar Jan 29 '18 20:01 davishd

https://stackoverflow.com/questions/48509026/cant-run-new-angular-cli-project/48509222#48509222

Just the question not a resolution

gitDylanHub avatar Jan 29 '18 20:01 gitDylanHub

Same issue here.

tuffs avatar Jan 29 '18 20:01 tuffs

Yep, I'm getting this too.

apbarratt avatar Jan 29 '18 20:01 apbarratt

Same issue. [email protected]

sgomanf avatar Jan 29 '18 20:01 sgomanf

I think it's anything 1.6.x and up? I can still ng serve an old project running 1.4.4

seekheart avatar Jan 29 '18 20:01 seekheart

Same issue on 1.6.6, it was working fine earlier.

tanwarsatya avatar Jan 29 '18 20:01 tanwarsatya

Latest install is using [email protected], specifying [email protected] in package.json solved the issue for me.

Eonfow avatar Jan 29 '18 20:01 Eonfow

@seekheart is correct, in the cli package json it's pulling in "uglifyjs-webpack-plugin": "^1.1.5", and the issue is with this package's recent 1.1.7 release.

as a temporary workaround, npm i --save-dev [email protected] in the local project does seem to fix the issue. Not the best solution, but it got ng serve to work.

EricWafford avatar Jan 29 '18 20:01 EricWafford

Confirm npm i --save-dev [email protected] temporarly fixes the issue

kikar avatar Jan 29 '18 20:01 kikar

Webpack published an empty uglifyjs-webpack-plugin. I contacted them and they're looking at it. Thanks for your patience.

hansl avatar Jan 29 '18 20:01 hansl

Workaround by @EricWafford temporaly fixed the problem

carlosoro avatar Jan 29 '18 20:01 carlosoro

kikar's workaround worked for me

raphaelLacerda avatar Jan 29 '18 20:01 raphaelLacerda

Same issue

carlospliego avatar Jan 29 '18 20:01 carlospliego

Seeing a fix as of now.

carlospliego avatar Jan 29 '18 20:01 carlospliego

After escalation and investigation, the webpack-contrib team released a new version 1.1.8 with everything proper in it. I'm going to close this issue as fixed, but we'll look into fixing our dependency versions (and why it wasn't fixed inthe first place). Thanks for your patience.

hansl avatar Jan 29 '18 20:01 hansl

What version you recommend to downgrade webpack, at this time?

jlozoya avatar Jan 29 '18 20:01 jlozoya

@jlozoya just run ng new app_name they downgraded their webpack. Works for me now.

carlospliego avatar Jan 29 '18 20:01 carlospliego