Closed Bengreen closed 7 years ago
I am having the same issue. I have tried it with node version 7.2.1 ,6.9 and 6.3.1.
Same issue . node version 6.9.1 , npm version 4.0.3
Seems like it is not a problem with webpack-starter but with ts 2.1.4. Relevant issue on awesome-typescript-loader repo
This boilerplate seems to work with pinned 2.1.1 v typescript
TypeScript is pinned in master to the latest working version. Keeping this issue open until we can pick up a 2.1.4
compliant version of awesome-typescript-loader
After googling this for a bit, I found this: https://github.com/s-panferov/awesome-typescript-loader/issues/190 - for me, clearing cache and changing package.json's typescript dependency from "^2.0.6" to "2.0.10" worked. The app builds and runs now.
In addition to @d3viant0ne 's commit of 9-Dec, I had to set "@angular/forms": "2.2.1"
(use to be ^2.2.1
, which brought me v2.3.0
). As I forked angular2-webpack-starter
before that commit of 23-Nov, it was ^2.2.1
just for the @angular/forms
.
So my full fix was:
package.json
to set:"typescript": "2.1.1"
(use to be ^2.0.6
, which brought me v2.1.4
)"@angular/forms": "2.2.1"
(use to be ^2.2.1
, which brought me v2.3.0
, when other @angular/
were 2.2.1
). As an alternative, you can make them all ^2.2.1
and it will work again as all @angular/
versions will be aligned.node_modules
and ran npm install
. For some reason, running npm install
straight away didn't work (something was cached?).Can confirm, modifiying my package.json
to "typescript": "2.1.1"
resolved the issue. I'm using "awesome-typescript-loader": "2.2.4"
for my angular 2.3.0 project.
After modifying the package.json
, I deleted the node_modules folder then ran npm cache clean
and finally npm install
. All is working fine now.
@dannypule and the same for me:
Html Webpack Plugin:
Error: Child compilation failed:
Entry module not found: Error: Can't resolve 'D:\' in 'D:\!Projects\TypeScript \test\angular2-webpack-2':
Error: Can't resolve 'D:\' in 'D:\!Projects\TypeScript\test\angular2-webpack-2 '
- compiler.js:76
[angular2-webpack-2]/[html-webpack-plugin]/lib/compiler.js:76:16
- Compiler.js:282 Compiler.
[angular2-webpack-2]/[webpack]/lib/Compiler.js:282:10
- Compiler.js:479
[angular2-webpack-2]/[webpack]/lib/Compiler.js:479:13
- Tapable.js:102 next
[angular2-webpack-2]/[tapable]/lib/Tapable.js:102:11
- CachePlugin.js:61 Compiler.
[angular2-webpack-2]/[webpack]/lib/CachePlugin.js:61:4
- Tapable.js:106 Compiler.applyPluginsAsyncSeries
[angular2-webpack-2]/[tapable]/lib/Tapable.js:106:13
- Compiler.js:476
[angular2-webpack-2]/[webpack]/lib/Compiler.js:476:10
- Tapable.js:95 Compilation.applyPluginsAsyncSeries
[angular2-webpack-2]/[tapable]/lib/Tapable.js:95:46
- Compilation.js:627
[angular2-webpack-2]/[webpack]/lib/Compilation.js:627:18
- Tapable.js:95 Compilation.applyPluginsAsyncSeries
[angular2-webpack-2]/[tapable]/lib/Tapable.js:95:46
- Compilation.js:618
[angular2-webpack-2]/[webpack]/lib/Compilation.js:618:10
- Tapable.js:95 Compilation.applyPluginsAsyncSeries
[angular2-webpack-2]/[tapable]/lib/Tapable.js:95:46
- Compilation.js:613
[angular2-webpack-2]/[webpack]/lib/Compilation.js:613:9
- Tapable.js:95 Compilation.applyPluginsAsyncSeries
[angular2-webpack-2]/[tapable]/lib/Tapable.js:95:46
- Compilation.js:609
[angular2-webpack-2]/[webpack]/lib/Compilation.js:609:8
- Tapable.js:95 Compilation.applyPluginsAsyncSeries
[angular2-webpack-2]/[tapable]/lib/Tapable.js:95:46
- Compilation.js:555 Compilation.seal
[angular2-webpack-2]/[webpack]/lib/Compilation.js:555:7
- Compiler.js:473
[angular2-webpack-2]/[webpack]/lib/Compiler.js:473:16
- Tapable.js:189
[angular2-webpack-2]/[tapable]/lib/Tapable.js:189:11
- Compilation.js:452 Compilation.
[angular2-webpack-2]/[webpack]/lib/Compilation.js:452:10
- Compilation.js:347 Compilation.errorAndCallback
[angular2-webpack-2]/[webpack]/lib/Compilation.js:347:3
- Compilation.js:364 Compilation.
[angular2-webpack-2]/[webpack]/lib/Compilation.js:364:11
+1
package.json
...
"dependencies": {
"@angular/common": "^2.2.4",
"@angular/compiler": "^2.2.4",
"@angular/compiler-cli": "^2.2.4",
"@angular/core": "^2.2.4",
"@angular/platform-browser": "^2.2.4",
"@angular/platform-browser-dynamic": "^2.2.4",
"@angular/platform-server": "^2.2.4",
"core-js": "^2.4.1",
"es6-promise": "^4.0.5",
"es6-shim": "^0.35.2",
"materialize-css": "^0.97.8",
"reflect-metadata": "^0.1.8",
"rxjs": "5.0.0-rc.4",
"zone.js": "^0.7.2"
},
"devDependencies": {
"@types/electron": "^1.3.20",
"@types/hammerjs": "^2.0.33",
"@types/jasmine": "^2.2.34",
"@types/lodash": "0.0.28",
"@types/node": "^6.0.38",
"@types/source-map": "^0.1.27",
"@types/uglify-js": "^2.0.27",
"@types/webpack": "2.0.0",
"angular2-template-loader": "^0.6.0",
"awesome-typescript-loader": "^2.2.4",
"clean-webpack-plugin": "^0.1.14",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.26.1",
"extract-text-webpack-plugin": "^2.0.0-beta.4",
"file-loader": "^0.9.0",
"html-webpack-plugin": "^2.24.1",
"imports-loader": "^0.6.5",
"jasmine-core": "^2.4.1",
"json-loader": "^0.5.4",
"node-sass": "^3.13.0",
"raw-loader": "^0.5.1",
"rimraf": "^2.5.4",
"sass-loader": "^4.0.2",
"style-loader": "^0.13.1",
"ts-helpers": "^1.1.2",
"ts-loader": "^1.2.2",
"tslint": "^4.0.2",
"tslint-loader": "^3.3.0",
"typescript": "2.1.1",
"url-loader": "^0.5.7",
"webpack": "^2.1.0-beta.28",
"webpack-dev-server": "^2.1.0-beta.12",
"webpack-md5-hash": "^0.0.5",
"webpack-merge": "^1.0.2"
}
}
Error log when compiling:
ERROR in ./~/css-loader!./~/sass-loader!./src/app/scripts/main.browser.ts
Module build failed:
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
^
Property "platformBrowserDynamic" must be followed by a ':'
in /Users/pcasme/repos/ng2-test/src/app/scripts/main.browser.ts (line 6, column 10)
@ ./src/app/scripts/main.browser.ts 4:14-133
ERROR in ./~/css-loader!./~/sass-loader!./~/timers-browserify/main.js
Module build failed:
var apply = Function.prototype.apply;
^
Invalid CSS after "v": expected 1 selector or at-rule, was "var apply = Functio"
in /Users/pcasme/repos/ng2-test/node_modules/timers-browserify/main.js (line 1, column 1)
@ ./~/timers-browserify/main.js 4:14-87
@ ./~/rxjs/util/Immediate.js
@ ./~/rxjs/scheduler/AsapAction.js
@ ./~/rxjs/scheduler/asap.js
@ ./~/rxjs/Rx.js
@ ./src/app/scripts/vendor.browser.ts
ERROR in ./~/timers-browserify/main.js
Module build failed: Error
at /Users/pcasme/repos/ng2-test/node_modules/webpack/lib/NormalModule.js:143:35
at /Users/pcasme/repos/ng2-test/node_modules/loader-runner/lib/LoaderRunner.js:359:11
at /Users/pcasme/repos/ng2-test/node_modules/loader-runner/lib/LoaderRunner.js:225:18
at context.callback (/Users/pcasme/repos/ng2-test/node_modules/loader-runner/lib/LoaderRunner.js:106:13)
at Object.onRender (/Users/pcasme/repos/ng2-test/node_modules/sass-loader/index.js:273:13)
at Object.<anonymous> (/Users/pcasme/repos/ng2-test/node_modules/sass-loader/node_modules/async/dist/async.js:2234:31)
at apply (/Users/pcasme/repos/ng2-test/node_modules/sass-loader/node_modules/async/dist/async.js:20:25)
at Object.<anonymous> (/Users/pcasme/repos/ng2-test/node_modules/sass-loader/node_modules/async/dist/async.js:56:12)
at Object.callback (/Users/pcasme/repos/ng2-test/node_modules/sass-loader/node_modules/async/dist/async.js:840:16)
at options.error (/Users/pcasme/repos/ng2-test/node_modules/node-sass/lib/index.js:289:32)
ERROR in /Users/pcasme/repos/ng2-test/node_modules/extract-text-webpack-plugin/loader.js?{"id":1,"omit":1,"remove":true}!/Users/pcasme/repos/ng2-test/node_modules/style-loader/index.js!/Users/pcasme/repos/ng2-test/node_modules/css-loader/index.js!/Users/pcasme/repos/ng2-test/node_modules/sass-loader/index.js!/Users/pcasme/repos/ng2-test/node_modules/timers-browserify/main.js doesn't export content
ERROR in ./src/app/scripts/main.browser.ts
Module build failed: Error
at /Users/pcasme/repos/ng2-test/node_modules/webpack/lib/NormalModule.js:143:35
at /Users/pcasme/repos/ng2-test/node_modules/loader-runner/lib/LoaderRunner.js:359:11
at /Users/pcasme/repos/ng2-test/node_modules/loader-runner/lib/LoaderRunner.js:225:18
at context.callback (/Users/pcasme/repos/ng2-test/node_modules/loader-runner/lib/LoaderRunner.js:106:13)
at Object.onRender (/Users/pcasme/repos/ng2-test/node_modules/sass-loader/index.js:273:13)
at Object.<anonymous> (/Users/pcasme/repos/ng2-test/node_modules/sass-loader/node_modules/async/dist/async.js:2234:31)
at apply (/Users/pcasme/repos/ng2-test/node_modules/sass-loader/node_modules/async/dist/async.js:20:25)
at Object.<anonymous> (/Users/pcasme/repos/ng2-test/node_modules/sass-loader/node_modules/async/dist/async.js:56:12)
at Object.callback (/Users/pcasme/repos/ng2-test/node_modules/sass-loader/node_modules/async/dist/async.js:840:16)
at options.error (/Users/pcasme/repos/ng2-test/node_modules/node-sass/lib/index.js:289:32)
ERROR in /Users/pcasme/repos/ng2-test/node_modules/awesome-typescript-loader/dist/entry.js!/Users/pcasme/repos/ng2-test/node_modules/angular2-template-loader/index.js!/Users/pcasme/repos/ng2-test/node_modules/extract-text-webpack-plugin/loader.js?{"id":1,"omit":1,"remove":true}!/Users/pcasme/repos/ng2-test/node_modules/style-loader/index.js!/Users/pcasme/repos/ng2-test/node_modules/css-loader/index.js!/Users/pcasme/repos/ng2-test/node_modules/sass-loader/index.js!/Users/pcasme/repos/ng2-test/src/app/scripts/main.browser.ts doesn't export content
ERROR in [default] /Users/pcasme/repos/ng2-test/src/app/scripts/main.browser.ts:10:10
Property 'hot' does not exist on type 'NodeModule'.
ERROR in [default] /Users/pcasme/repos/ng2-test/src/app/scripts/main.browser.ts:13:9
Property 'hot' does not exist on type 'NodeModule'.
ERROR in [default] /Users/pcasme/repos/ng2-test/src/app/scripts/main.browser.ts:20:8
Property 'hot' does not exist on type 'NodeModule'.
Child html-webpack-plugin for "index.html":
[0] ./~/html-webpack-plugin/lib/loader.js!./src/app/index.html 534 bytes {0} [built]
Child extract-text-webpack-plugin:
+ 1 hidden modules
ERROR in ./~/css-loader!./~/sass-loader!./~/timers-browserify/main.js
Module build failed:
var apply = Function.prototype.apply;
^
Invalid CSS after "v": expected 1 selector or at-rule, was "var apply = Functio"
in /Users/pcasme/repos/ng2-test/node_modules/timers-browserify/main.js (line 1, column 1)
Child extract-text-webpack-plugin:
[0] ./~/css-loader!./~/sass-loader!./src/app/scripts/main.browser.ts 289 bytes {0} [built] [failed] [1 error]
ERROR in ./~/css-loader!./~/sass-loader!./src/app/scripts/main.browser.ts
Module build failed:
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
^
Property "platformBrowserDynamic" must be followed by a ':'
in /Users/pcasme/repos/ng2-test/src/app/scripts/main.browser.ts (line 6, column 10)
I have found what causes this problem in my case:
If I understand correctly, they filter out the character !
from path, but !
is legal character in Windows path.
https://github.com/angular/angular-cli/issues/3529#issuecomment-266737336
Pinning typescript to v2.1.1 in package.json worked for me too. Thanks.
So started with ng-book2 for Angular and cannot even do the App Works! because of this stuff
Pinning typescript to v2.1.1 didn't help me. My error is as following:
Module not found: Error: Can't resolve 'C:\' in 'C:\Users\Dan\Desktop\angular2-webpack-starter-master'
my package.json:
{
"name": "angular2-webpack-starter",
"version": "5.1.1",
"description": "An Angular 2 Webpack Starter kit featuring Angular 2 (Router, Http, Forms, Services, Tests, E2E, Coverage), Karma, Protractor, Jasmine, Istanbul, TypeScript, and Webpack by AngularClass",
"keywords": [
"angular2",
"webpack",
"typescript"
],
"author": "Patrick Stapleton <patrick@angularclass.com>",
"homepage": "https://github.com/angularclass/angular2-webpack-starter",
"license": "MIT",
"scripts": {
"build:aot:prod": "npm run clean:dist && npm run clean:aot && npm run ngc -- --webpack config/webpack.prod.js && webpack --config config/webpack.prod.js --progress --profile --bail",
"build:aot": "npm run build:aot:prod",
"build:dev": "npm run clean:dist && webpack --config config/webpack.dev.js --progress --profile",
"build:docker": "npm run build:prod && docker build -t angular2-webpack-start:latest .",
"build:prod": "npm run clean:dist && webpack --config config/webpack.prod.js --progress --profile --bail",
"build": "npm run build:dev",
"ci:aot": "npm run lint && npm run test && npm run build:aot && npm run e2e",
"ci:jit": "npm run lint && npm run test && npm run build:prod && npm run e2e",
"ci:nobuild": "npm run lint && npm test && npm run e2e",
"ci:testall": "npm run lint && npm run test && npm run build:prod && npm run e2e && npm run build:aot && npm run e2e",
"ci": "npm run ci:testall",
"clean:aot": "npm run rimraf -- compiled",
"clean:dist": "npm run rimraf -- dist",
"clean:install": "npm set progress=false && npm install",
"clean:start": "npm start",
"clean": "npm cache clean && npm run rimraf -- node_modules doc coverage dist compiled",
"docker": "docker",
"docs": "npm run typedoc -- --options typedoc.json --exclude '**/*.spec.ts' ./src/",
"e2e:live": "npm run e2e -- --elementExplorer",
"e2e": "npm-run-all -p -r server:prod:ci e2e:only",
"e2e:only": "npm run protractor",
"github-deploy:dev": "webpack --config config/webpack.github-deploy.js --progress --profile --env.githubDev",
"github-deploy:prod": "webpack --config config/webpack.github-deploy.js --progress --profile --env.githubProd",
"github-deploy": "npm run github-deploy:dev",
"lint": "npm run tslint \"src/**/*.ts\"",
"ngc": "./node_modules/.bin/ngc-w -p tsconfig.webpack.json",
"postversion": "git push && git push --tags",
"prebuild:dev": "npm run clean:dist",
"prebuild:prod": "npm run clean:dist",
"preclean:install": "npm run clean",
"preclean:start": "npm run clean",
"pree2e": "npm run webdriver:update -- --standalone",
"preversion": "npm test",
"protractor": "protractor",
"rimraf": "rimraf",
"server:dev:hmr": "npm run server:dev -- --inline --hot",
"server:dev": "webpack-dev-server --config config/webpack.dev.js --progress --profile --open --watch --content-base src /",
"server:prod": "http-server dist -c-1 --cors",
"server:prod:ci": "http-server dist -p 3000 -c-1 --cors",
"server": "npm run server:dev",
"start:hmr": "npm run server:dev:hmr",
"start": "npm run server:dev",
"test": "karma start",
"tslint": "tslint",
"typedoc": "typedoc",
"version": "npm run build",
"watch:dev:hmr": "npm run watch:dev -- --hot",
"watch:dev": "npm run build:dev -- --watch",
"watch:prod": "npm run build:prod -- --watch",
"watch:test": "npm run test -- --auto-watch --no-single-run",
"watch": "npm run watch:dev",
"webdriver-manager": "webdriver-manager",
"webdriver:start": "npm run webdriver-manager start",
"webdriver:update": "npm run webdriver-manager update",
"webpack-dev-server": "webpack-dev-server",
"webpack": "webpack"
},
"dependencies": {
"@angular/common": "~2.4.1",
"@angular/compiler": "~2.4.1",
"@angular/core": "~2.4.1",
"@angular/forms": "~2.4.1",
"@angular/http": "~2.4.1",
"@angular/platform-browser": "~2.4.1",
"@angular/platform-browser-dynamic": "~2.4.1",
"@angular/platform-server": "~2.4.1",
"@angular/router": "~3.4.1",
"@angularclass/conventions-loader": "^1.0.2",
"@angularclass/hmr": "~1.2.2",
"@angularclass/hmr-loader": "~3.0.2",
"assets-webpack-plugin": "^3.4.0",
"core-js": "^2.4.1",
"http-server": "^0.9.0",
"ie-shim": "^0.1.0",
"reflect-metadata": "^0.1.9",
"rxjs": "~5.0.2",
"zone.js": "~0.7.4"
},
"devDependencies": {
"@angular/compiler-cli": "~2.4.1",
"@types/hammerjs": "^2.0.33",
"@types/jasmine": "^2.2.34",
"@types/node": "^6.0.38",
"@types/selenium-webdriver": "2.53.33",
"@types/source-map": "^0.1.27",
"@types/uglify-js": "^2.0.27",
"@types/webpack": "^2.0.0",
"angular-router-loader": "^0.4.0",
"angular2-template-loader": "^0.6.0",
"awesome-typescript-loader": "~3.0.0-beta.17",
"codelyzer": "~1.0.0-beta.4",
"copy-webpack-plugin": "^4.0.0",
"css-loader": "^0.26.0",
"exports-loader": "^0.6.3",
"expose-loader": "^0.7.1",
"file-loader": "^0.9.0",
"gh-pages": "^0.12.0",
"html-webpack-plugin": "^2.21.0",
"imports-loader": "^0.6.5",
"istanbul-instrumenter-loader": "0.2.0",
"json-loader": "^0.5.4",
"karma": "^1.2.0",
"karma-chrome-launcher": "^2.0.0",
"karma-coverage": "^1.1.1",
"karma-jasmine": "^1.0.2",
"karma-mocha-reporter": "^2.0.0",
"karma-remap-coverage": "^0.1.1",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "1.8.0",
"ngc-webpack": "^1.0.2",
"npm-run-all": "^3.1.2",
"parse5": "^2.2.2",
"protractor": "^4.0.10",
"raw-loader": "0.5.1",
"rimraf": "~2.5.4",
"script-ext-html-webpack-plugin": "^1.3.2",
"source-map-loader": "^0.1.5",
"string-replace-loader": "1.0.5",
"style-loader": "^0.13.1",
"to-string-loader": "^1.1.4",
"ts-helpers": "1.1.2",
"ts-node": "^1.7.0",
"tslint": "~3.15.1",
"tslint-loader": "^2.1.5",
"typedoc": "^0.5.0",
"typescript": "2.1.1",
"url-loader": "^0.5.7",
"v8-lazy-parse-webpack-plugin": "^0.3.0",
"webpack": "2.2.0-rc.2",
"webpack-dev-middleware": "^1.6.1",
"webpack-dev-server": "2.2.0-rc.0",
"webpack-md5-hash": "^0.0.5",
"webpack-merge": "~1.0.1"
},
"repository": {
"type": "git",
"url": "https://github.com/angularclass/angular2-webpack-starter.git"
},
"bugs": {
"url": "https://github.com/angularclass/angular2-webpack-starter/issues"
},
"engines": {
"node": ">= 4.2.1",
"npm": ">= 3"
}
}
Versions:
npm -v: 3.10.8
node -v: 6.7.0
It worked for me by pinning typescript to 2.1.1
in package.json
with node 5.6.0
and npm 3.6.0
.
change typescript version to 2.1.1 or 2.0.10 in package.json. It worked for me node 6.9.4 and npm 4.0.5
Note: for support questions, please use one of these channels: Chat: AngularClass.slack or Twitter: @AngularClass
I'm submitting a ... [x] bug report [ ] feature request [ ] question about the decisions made in the repository
Do you want to request a feature or report a bug? I did a fresh checkout of angular2-webpack-starter, but it will NOT build properly with an error I cannot easily solve.
What is the current behavior? I did a git checkout i did npm install
Then when I run npm start I get errors:
AND
I am building on OSX with npm: 3.10.9 and node 7.2.1
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar (you can use this template as a starting point: http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5).
What is the expected behavior?
What is the motivation / use case for changing the behavior?
Please tell us about your environment:
Angular version: 2.0.0-beta.X
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)