Angular webpack not working ```npm run webpack-dev-server --inline --progress --port 8080```
Versions
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 6.2.5
Node: 8.11.3
OS: darwin x64
Angular: 4.2.6
... common, compiler, core, forms, http, platform-browser
... platform-browser-dynamic, router
Package Version
------------------------------------------------------
@angular-devkit/architect 0.8.5
@angular-devkit/core 0.8.5
@angular-devkit/schematics 0.8.5
@angular/cli 6.2.5
@schematics/angular 0.8.5
@schematics/update 0.8.5
rxjs 5.0.1
typescript 2.0.10
webpack 2.2.1
Repro steps
- Update @angular/cli
ng updatenpm install webpack - I have update typescript & webpack
The log given by the failure
- run this command -
npm run webpack-dev-server --inline --progress --port 8080
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 ../src/main.ts
[at-loader] Using [email protected] from typescript and "tsconfig.json" from ../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.
Desired functionality
- webpack: compiled successfully
Mention any other details that might be useful
- I have removed the
node_modulesandreinstallagain but I have observed the same error, after update the version of webpack & downgrade typescript, still have same problem.
Please share the solution if anyone found.
Which versions of TypeScript have you tried to install? As from the logs above, it looks like you are using a TypeScript 2.0.1.
Angular 6, requires at least version 2.7.2.
Also the Webpack version you are trying to install is also outdated. Angular Devkit requires versions 4. You don’t need to specify webpack dependency in your package.json yourself as it is a transitive dependency.
Which versions of TypeScript have you tried to install? As from the logs above, it looks like you are using a TypeScript 2.0.1.
Angular 6, requires at least version 2.7.2.
Also the Webpack version you are trying to install is also outdated. Angular Devkit requires versions 4. You don’t need to specify webpack dependency in your package.json yourself as it is a transitive dependency.
- First of all thanks for your kind reply.
Okay as you suggest I did that change -
- I have updated the
TypeScript - 2.7.2 - After that I have removed the
webpack versionfrom package.json file
Error: Cannot find module 'webpack'
Webpack removed
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 6.2.5
Node: 8.11.3
OS: darwin x64
Angular: 4.2.6
... common, compiler, core, forms, http, platform-browser
... platform-browser-dynamic, router
Package Version
------------------------------------------------------
@angular-devkit/architect 0.8.5
@angular-devkit/core 0.8.5
@angular-devkit/schematics 0.8.5
@angular/cli 6.2.5
@schematics/angular 0.8.5
@schematics/update 0.8.5
rxjs 5.0.1
typescript 2.9.2
Now I have update the latest version of TypeScript - 3.1.4 & webpack- 4.23.1
Typescript & webpack updated
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 6.2.5
Node: 8.11.3
OS: darwin x64
Angular: 4.2.6
... common, compiler, core, forms, http, platform-browser
... platform-browser-dynamic, router
Package Version
------------------------------------------------------
@angular-devkit/architect 0.8.5
@angular-devkit/core 0.8.5
@angular-devkit/schematics 0.8.5
@angular/cli 6.2.5
@schematics/angular 0.8.5
@schematics/update 0.8.5
rxjs 5.0.1
typescript 3.1.4
webpack 4.23.1
Issue is still open, without webpack there is a module error, with webpack please check above logs
By mistake I click on close and comment, so I re-open this issue
- Issue is still open & not fixed
- Please check the logs
If something is not clear, please feel free to comments.
Seeing the logs above, it doesn’t seem that you using ng serve or ng build to build the application nor @ngtools/webpack. It looks like you are using a custom build pipeline which in that case we are unable to provide support for unless it’s a bug from one of the devkit packages which doesn’t look to be the case here.
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.