Skip to content

Webpack update breaks use of dynamic template URLs #1605

@Phatsuo

Description

@Phatsuo
  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

Win10 x64

  1. Versions. Please run ng --version. If there's nothing outputted, please run
    in a Terminal: node --version and paste the result here:

angular-cli: 1.0.0-beta.11-webpack
node: 5.10.1
os: win32 x64

  1. 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

  1. 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

  1. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P5The team acknowledges the request but does not plan to address it, it remains open for discussiontype: bug/fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions