Skip to content

NamedExports from barrel files are not dynamically imported for lazy loading properly. #14707

Closed
@FrozenPandaz

Description

@FrozenPandaz

🐞 Bug report

Command (mark with an x)

- [x] build
- [x] serve

Is this a regression?

Yes, the previous version in which this bug was not present was: ....

Yes, sort of. This worked in 7 with the loadChildren strings but does not work in 8.

Description

A clear and concise description of the problem...

This was originally reported in nrwl/nx#1471.

This is an extension of #14399. The fix for that issue solves it for unnamed ExportDeclarations but not for NamedExports.

// export * from './lib/my.module'; // This works
export { MyModule } from './lib/my.module'; // This does not work

🔬 Minimal Reproduction

https://github.com/FrozenPandaz/demos/blob/lazybug/libs/lib1/src/index.ts

🔥 Exception or Error

ERROR in ./src/app/app.module.ts
Module not found: Error: Can't resolve './../../../../libs/lib1/src/index.ngfactory' in '/Users/jason/projects/temp/temp/nx8-test/apps/app1/src/app'

🌍 Your Environment

8.0.1

Anything else relevant?
May affect Nx Users.

cc @filipesilva who resolved #14399

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions