Skip to content

Error trying to load lazy-loaded module #14462

@YagoLopez

Description

@YagoLopez

I'm submitting a:
[ x] bug report

Current behavior
Error lazy-loading modules. Path to lazy loaded module incorrect. Probably It has something to do with concatenating strings

Expected behavior
Lazy loaded path should be created correctly

Minimal reproduction of the problem with instructions
For example:

Defining the route:

{path: '', loadChildren: './app/pages/button/pageButtonModule'},

throws the following error:

Error: Uncaught (in promise): Error: Fetch error: 404 Not Found
(WRONG PATH->) Instantiating http://127.0.0.1:8080/src//pp/pages/button/pageButtonModule.js
  Loading ./app/pages/button/pageButtonModule
Error: Fetch error: 404 Not Found
    at :8080/node_modules/systemjs/dist/system.src.js:1436:13 [angular]
    at Object.onInvoke (core.umd.js:3980) [angular]
    at Zone.run (zone.js:113) [angular => angular]
    at eval (zone.js:535) [angular]
    at Object.onInvokeTask (core.umd.js:3971) [angular]
    at ZoneDelegate.invokeTask (zone.js:274) [angular]
    at Zone.runTask (zone.js:151) [<root> => angular]
    at drainMicroTaskQueue (zone.js:433) [<root>]
    at resolvePromise (zone.js:501) [angular]
    at resolvePromise (zone.js:486) [angular]
    at eval (zone.js:535) [angular]
    at Object.onInvokeTask (core.umd.js:3971) [angular]
    at ZoneDelegate.invokeTask (zone.js:274) [angular]
    at Zone.runTask (zone.js:151) [<root> => angular]
    at drainMicroTaskQueue (zone.js:433) [<root>]

Please tell us about your environment:
Windows 10, Webstorm
SYSTEMJS 0.20.7
(Not using angular-cli nor webpack to serve the app.)
latest versions of npm and node

  • Angular version: 2.4.7

  • Browser: Chrome 56.0.2924.87 (64-bit)

  • Language: [TypeScript 2.0.2]

  • Node (for AoT issues): node --version = 6.9.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions