-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Description
- OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
Win10 x64
- Versions. Please run
ng --version. If there's nothing outputted, please run
in a Terminal:node --versionand paste the result here:
angular-cli: 1.0.0-beta.11-webpack
node: 5.10.1
os: win32 x64
- Repro steps. Was this an app that wasn't created using the CLI? What change did you
do on your code? etc.
a) Generate default project.
b) In app.component.ts, change the templateUrl to '/templates/app'
c) run ng build
- The log given by the failure. Normally this include a stack trace and some
more information.
ERROR in ./src/app/app.component.ts
Module not found: Error: Can't resolve './/templates/app' in 'D:\Dev\Junk\WebApplication19-Core-And-Angular-CLI\src\WebApplication19-Core-And-Angular-CLI\src\app'
@ ./src/app/app.component.ts 18:22-49
@ ./src/app/index.ts
@ ./src/main.ts
@ multi main
- Mention any other details that might be useful.
This worked fine in previous CLI versions using systemjs.
I believe this is because something (maybe angular2-webpack-starter or similar) is attempting to inline the template. This will not work because the template is dynamically generated on the server.
This could potentially be fixed by editing the webpack.config - but the Angular CLI does not allow that.
Perhaps instead of an error, this could be a warning, and it could leave the templateUrl setting as-is.