Skip to content

when use SystemJsNgModuleLoader, cannot find module #5981

Closed

Description

@vivian7169

Bug Report or Feature Request (mark with an x)

- [ bug report ]
ERROR Error: Uncaught (in promise): Error: Cannot find module './app/example/template/test-template/test-template.module'.

### Versions.
@angular/cli: 1.0.0
node: 6.9.4
os: darwin x64

### Repro steps.
when load dynamic module, using SystemJsNgModuleLoader.load(this.path), in browser inspect, got this error: "ERROR Error: Uncaught (in promise): Error: Cannot find module "'./app/example/template/test-template/test-template.module'
files path:
-src/app/example/template/test-template/test-template.module.ts
-src/app/example/example.component.ts

In example.component.ts, I tried to use this.path as below but all cannot work :
1. src/app/example/template/test-template/test-template.module
2. app/example/template/test-template/test-template.module
3. ./app/example/template/test-template/test-template.module
4. ./template/test-template/test-template.module

### Mention any other details that might be useful.
Does angular-cli allow us to load a module dynamically?

Thanks.

Activity

  1. elainaRenee commented on Apr 27, 2017

    @elainaRenee

    I am having this issue as well

  2. oparisy commented on Apr 28, 2017

    @oparisy

    Same thing. I cannot seem to be able to dynamically load an external module.

    By "external" I mean "not available to angular-cli during the ng build phase" (but independently compiled using tsc).

  3. filipesilva commented on May 5, 2017

    @filipesilva
    Contributor

    I think this isn't supported, roughly for the same reason as custom routers are not supported: #4541.

    I'll refer your issue there as this is part of a bigger topic.

  4. angular-automatic-lock-bot commented on Sep 7, 2019

    @angular-automatic-lock-bot

    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.

  5. locked and limited conversation to collaborators on Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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