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

New angular-cli generated project has webpack error

Open rbirkgit opened this issue 9 years ago • 7 comments

Bug Report or Feature Request (mark with an x)

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

Versions.

1.2.2

Repro steps.

Generate new project

The log given by the failure.

After projects gets generated I do this: "npm ls --depth=0"

That shows:

npm ERR! peer dep missing: webpack@^2.2.0, required by [email protected]

Desired functionality.

No errors

Mention any other details that might be useful.

rbirkgit avatar Jul 21 '17 06:07 rbirkgit

@angular/cli dependency should be updated to [email protected]

viliks avatar Jul 21 '17 11:07 viliks

Revert back to 1.2.1 for the time being, the issue is due to version 1.2.2 using webpack 3.3.0 https://github.com/angular/angular-cli/blob/1.2.x/packages/%40angular/cli/package.json#L85

Rather than 2.4.0 https://github.com/angular/angular-cli/blob/v1.2.1/package.json#L99

You can revert using the following commands:

npm uninstall -g @angular/cli
npm cache clean
npm install -g @angular/[email protected]

RicardoVaranda avatar Jul 21 '17 12:07 RicardoVaranda

Just wanted to chine in as a maintainer and highlight @RicardoVaranda's comment. This was a mistake on our part.

filipesilva avatar Jul 21 '17 15:07 filipesilva

Closing as outdated.

filipesilva avatar Jan 17 '18 09:01 filipesilva

Angular webpack issue - I have facing this error from 1 week - could anyone support me why this error comes in picture

Run

npm run webpack-dev-server --inline --progress --port 8080

Console Error


 10% building modules 3/3 modules 0 active
Project is running at http://localhost:8080/
webpack output is served from /
404s will fallback to /index.html
 10% building modules 7/10 modules 3 active .../bhai/accordionassignment/src/main.ts
[at-loader] Using [email protected] from typescript and "tsconfig.json" from /Users/amiteshsingh/Desktop/bhai/accordionassignment/src/tsconfig.json.

 **94% asset optimization
[at-loader] Checking started in a separate process...**

**[at-loader] Checking finished with 124 errors**
chunk    {0} vendor.js (vendor) 2.74 MB {2} [initial] [rendered]
chunk    {1} app.js (app) 12.1 kB {0} [initial] [rendered]
chunk    {2} polyfills.js (polyfills) 626 kB [entry] [rendered]

ERROR in [at-loader]./node_modules/@angular/common/src/location/platform_location.d.ts:47:59
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@angular/common/src/pipes/async_pipe.d.ts:47:23
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@angular/common/src/platform_id.d.ts:8:42
    TS1039: Initializers are not allowed in ambient contexts.

ERROR in [at-loader] ./node_modules/@angular/common/src/platform_id.d.ts:9:41
    TS1039: Initializers are not allowed in ambient contexts.

ERROR in [at-loader] ./node_modules/@angular/common/src/platform_id.d.ts:10:45
    TS1039: Initializers are not allowed in ambient contexts.

ERROR in [at-loader] ./node_modules/@angular/common/src/platform_id.d.ts:11:44
    TS1039: Initializers are not allowed in ambient contexts.

ERROR in [at-loader] ./node_modules/@angular/compiler/src/aot/compiler.d.ts:40:47
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@angular/compiler/src/aot/compiler_host.d.ts:18:33
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@angular/compiler/src/i18n/extractor.d.ts:14:33
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@angular/compiler/src/i18n/extractor.d.ts:22:35
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@angular/compiler/src/jit/compiler.d.ts:43:49
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@angular/compiler/src/jit/compiler.d.ts:45:65
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@angular/compiler/src/metadata_resolver.d.ts:71:104
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@angular/compiler/src/resource_loader.d.ts:13:23
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@angular/compiler/src/util.d.ts:2:36
    TS1039: Initializers are not allowed in ambient contexts.

ERROR in [at-loader] ./node_modules/@angular/compiler/src/util.d.ts:26:40
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@angular/core/src/animation/animation_metadata_wrapped.d.ts:12:33
    TS1039: Initializers are not allowed in ambient contexts.

ERROR in [at-loader] ./node_modules/@angular/core/src/animation/dsl.d.ts:81:33
    TS1039: Initializers are not allowed in ambient contexts.

ERROR in [at-loader] ./node_modules/@angular/core/src/application_init.d.ts:21:27
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@angular/core/src/application_ref.d.ts:116:76
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@angular/core/src/application_ref.d.ts:132:110
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@angular/core/src/application_ref.d.ts:162:67
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@angular/core/src/application_ref.d.ts:164:101
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@angular/core/src/errors.d.ts:9:33
    TS1039: Initializers are not allowed in ambient contexts.

ERROR in [at-loader] ./node_modules/@angular/core/src/errors.d.ts:10:43
    TS1039: Initializers are not allowed in ambient contexts.

ERROR in [at-loader] ./node_modules/@angular/core/src/errors.d.ts:11:42
    TS1039: Initializers are not allowed in ambient contexts.

ERROR in [at-loader] ./node_modules/@angular/core/src/errors.d.ts:12:43
    TS1039: Initializers are not allowed in ambient contexts.

ERROR in [at-loader] ./node_modules/@angular/core/src/errors.d.ts:13:35
    TS1039: Initializers are not allowed in ambient contexts.

ERROR in [at-loader] ./node_modules/@angular/core/src/linker/compiler.d.ts:43:49
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@angular/core/src/linker/compiler.d.ts:51:65
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@angular/core/src/linker/ng_module_factory_loader.d.ts:14:34
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@angular/core/src/linker/system_js_ng_module_factory_loader.d.ts:28:25
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@angular/core/src/render/api.d.ts:109:36
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@angular/core/src/util/lang.d.ts:12:53
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@angular/core/testing/src/before_each.d.ts:1:59
    TS1039: Initializers are not allowed in ambient contexts.

ERROR in [at-loader] ./node_modules/@angular/core/testing/src/component_fixture.d.ts:74:19
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@angular/core/testing/src/component_fixture.d.ts:79:26
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@angular/core/testing/src/test_bed.d.ts:85:33
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@angular/core/testing/src/test_bed.d.ts:146:26
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@angular/http/src/backends/browser_jsonp.d.ts:1:33
    TS1039: Initializers are not allowed in ambient contexts.

ERROR in [at-loader] ./node_modules/@angular/platform-browser-dynamic/src/resource_loader/resource_loader_impl.d.ts:10:23
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@angular/platform-browser/src/dom/dom_renderer.d.ts:14:41
    TS1039: Initializers are not allowed in ambient contexts.

ERROR in [at-loader] ./node_modules/@angular/router/src/config.d.ts:309:85
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@angular/router/src/interfaces.d.ts:78:99
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@angular/router/src/interfaces.d.ts:157:109
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@angular/router/src/interfaces.d.ts:229:162
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@angular/router/src/interfaces.d.ts:299:89
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@angular/router/src/interfaces.d.ts:367:50
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@angular/router/src/router.d.ts:275:70
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@angular/router/src/router.d.ts:297:59
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@angular/router/src/router_module.d.ts:186:23
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@angular/router/src/shared.d.ts:15:37
    TS1039: Initializers are not allowed in ambient contexts.

ERROR in [at-loader] ./node_modules/@angular/router/src/utils/collection.d.ts:28:79
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:355:48
    TS2304: Cannot find name 'PropertyKey'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:356:52
    TS2304: Cannot find name 'PropertyKey'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:357:34
    TS2304: Cannot find name 'PropertyKey'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:358:34
    TS2304: Cannot find name 'PropertyKey'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:359:34
    TS2304: Cannot find name 'PropertyKey'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:360:61
    TS2304: Cannot find name 'PropertyKey'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:361:60
    TS2304: Cannot find name 'PropertyKey'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:362:65
    TS2304: Cannot find name 'PropertyKey'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:362:97
    TS2304: Cannot find name 'PropertyKey'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:363:60
    TS2304: Cannot find name 'PropertyKey'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:364:58
    TS2304: Cannot find name 'PropertyKey'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:365:59
    TS2304: Cannot find name 'PropertyKey'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:366:58
    TS2304: Cannot find name 'PropertyKey'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:367:61
    TS2304: Cannot find name 'PropertyKey'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:367:117
    TS2304: Cannot find name 'PropertyKey'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:368:42
    TS2304: Cannot find name 'PropertyKey'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:370:81
    TS2304: Cannot find name 'PropertyKey'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:371:78
    TS2304: Cannot find name 'PropertyKey'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:372:76
    TS2304: Cannot find name 'PropertyKey'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:373:73
    TS2304: Cannot find name 'PropertyKey'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:461:39
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:469:59
    TS2304: Cannot find name 'PropertyKey'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:470:59
    TS2304: Cannot find name 'PropertyKey'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:472:48
    TS2304: Cannot find name 'PropertyKey'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:473:69
    TS2304: Cannot find name 'PropertyKey'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:477:40
    TS2304: Cannot find name 'PropertyKey'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:479:48
    TS2304: Cannot find name 'PropertyKey'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:695:55
    TS2304: Cannot find name 'PropertyKey'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:696:45
    TS2304: Cannot find name 'PropertyKey'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:829:20
    TS2304: Cannot find name 'PromiseConstructor'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:859:35
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:1486:36
    TS2339: Property 'for' does not exist on type 'SymbolConstructor'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:1490:43
    TS2339: Property 'hasInstance' does not exist on type 'SymbolConstructor'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:1494:50
    TS2339: Property 'isConcatSpreadable' does not exist on type 'SymbolConstructor'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:1502:38
    TS2339: Property 'keyFor' does not exist on type 'SymbolConstructor'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:1506:37
    TS2339: Property 'match' does not exist on type 'SymbolConstructor'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:1510:39
    TS2339: Property 'replace' does not exist on type 'SymbolConstructor'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:1514:38
    TS2339: Property 'search' does not exist on type 'SymbolConstructor'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:1518:39
    TS2339: Property 'species' does not exist on type 'SymbolConstructor'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:1522:37
    TS2339: Property 'split' does not exist on type 'SymbolConstructor'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:1526:43
    TS2339: Property 'toPrimitive' does not exist on type 'SymbolConstructor'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:1530:43
    TS2339: Property 'toStringTag' does not exist on type 'SymbolConstructor'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:1534:43
    TS2339: Property 'unscopables' does not exist on type 'SymbolConstructor'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:2305:36
    TS2339: Property 'for' does not exist on type 'SymbolConstructor'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:2309:43
    TS2339: Property 'hasInstance' does not exist on type 'SymbolConstructor'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:2313:50
    TS2339: Property 'isConcatSpreadable' does not exist on type 'SymbolConstructor'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:2321:38
    TS2339: Property 'keyFor' does not exist on type 'SymbolConstructor'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:2325:37
    TS2339: Property 'match' does not exist on type 'SymbolConstructor'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:2329:39
    TS2339: Property 'replace' does not exist on type 'SymbolConstructor'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:2333:38
    TS2339: Property 'search' does not exist on type 'SymbolConstructor'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:2337:39
    TS2339: Property 'species' does not exist on type 'SymbolConstructor'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:2341:37
    TS2339: Property 'split' does not exist on type 'SymbolConstructor'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:2345:43
    TS2339: Property 'toPrimitive' does not exist on type 'SymbolConstructor'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:2349:43
    TS2339: Property 'toStringTag' does not exist on type 'SymbolConstructor'.

ERROR in [at-loader] ./node_modules/@types/core-js/index.d.ts:2353:43
    TS2339: Property 'unscopables' does not exist on type 'SymbolConstructor'.

ERROR in [at-loader] ./node_modules/rxjs/Observable.d.ts:68:60
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/rxjs/Observable.d.ts:68:70
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/rxjs/observable/PromiseObservable.d.ts:40:31
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/rxjs/observable/PromiseObservable.d.ts:41:26
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/rxjs/operator/toPromise.d.ts:2:60
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/rxjs/operator/toPromise.d.ts:3:79
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./node_modules/rxjs/operator/toPromise.d.ts:3:89
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] ./src/app/app.component.ts:8:14
    TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning.

ERROR in [at-loader] ./src/app/app.module.ts:15:14
    TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning.

ERROR in [at-loader] ./src/app/components/container/container.component.spec.ts:5:34
    TS2307: Cannot find module '@angular/common/http'.

ERROR in [at-loader] ./src/app/components/container/container.component.ts:10:14
    TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning.

ERROR in [at-loader] ./src/app/components/header/header.component.ts:8:14
    TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning.

ERROR in [at-loader] ./src/app/services/ServiceAccordion.ts:1:28
    TS2307: Cannot find module '@angular/common/http'.

ERROR in [at-loader] ./src/app/services/ServiceAccordion.ts:6:14
    TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning.

ERROR in [at-loader] ./src/main.ts:7:43
    TS2339: Property 'ENV' does not exist on type 'ProcessEnv'.

ERROR in [at-loader] ./src/polyfills.ts:84:17
    TS2339: Property 'ENV' does not exist on type 'ProcessEnv'.
Child html-webpack-plugin for "index.html":
    chunk    {0} index.html 662 bytes [entry] [rendered]
webpack: Failed to compile.

Package.json/tsconfig.json

  • I have take from angular webpack https://v5.angular.io/guide/webpack

Please share if anyone resolve this issue awaiting...

amitesh786 avatar Oct 26 '18 15:10 amitesh786

Visit the angular webpack website, I have mentioned direct link https://v5.angular.io/guide/webpack

  • Update the package.json
  • After that remove node_modules rm -rf node_modules/
  • Install npm install
  • run the command as you mentioned above - npm ls --depth=0
├── @angular/[email protected]
├── @angular/[email protected]
├── @angular/[email protected]
├── @angular/[email protected]
├── @angular/[email protected]
├── @angular/[email protected]
├── @angular/[email protected]
├── @angular/[email protected]
├── @angular/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]
  • I have re-created this problem, as I can see the version issue. So just visit the website and update the version.

amitesh786 avatar Oct 26 '18 22:10 amitesh786

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.