Skip to content

Duplicate LAZY_ROUTE_MAP exports with platform server in 1.3.0-rc.0 #7116

@intellix

Description

@intellix

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

CLI 1.3.0-rc.0

Repro steps.

Was just playing with this and found an issue with a particular export pattern in barrels that is broken: https://github.com/intellix/universal-cli@8ed967d#diff-a44e09a3c12667be300e8cb75d793c5dR1

Worked inside app/user/index.ts:

export * from './user.module';
export * from './user.service';

Didn't work inside app/user/index.ts:

export { UserModule } from './user.module';
export { UserService } from './user.service';

The log given by the failure.

Date: 2017-07-22T06:19:07.696Z
Hash: f089fcd9ebdfb15dd64e
Time: 2950ms
chunk {main} main.bundle.js (main) 20.8 kB [entry] [rendered]
chunk {polyfills} polyfills.bundle.js (polyfills) 6.35 kB [entry] [rendered]
chunk {styles} styles.bundle.js (styles) 13.7 kB [entry] [rendered]


ERROR in ./src/app/user/index.ts
Module parse failed: /Users/dominic/Sites/test/universal/node_modules/@ngtools/webpack/src/index.js!/Users/dominic/Sites/test/universal/src/app/user/index.ts Duplicate export 'LAZY_MODULE_MAP' (5:11)
You may need an appropriate loader to handle this file type.
| export var LAZY_MODULE_MAP = { "./lazy/lazy.module#LazyModule": __lazy_0__.LazyModule };
| export { UserService } from './user.service';
| export var LAZY_MODULE_MAP = { "./lazy/lazy.module#LazyModule": __lazy_0__.LazyModule };
| //# sourceMappingURL=index.js.map
@ ./src/app/app.module.ts 12:0-36
@ ./src/main.server.ts
@ multi ./src/main.server.ts

Desired functionality.

You should be able to have files including: import { x } from 'y'; without a build error when using server platform.

Mention any other details that might be useful.

Created this as asked by FrozenPandaz inside: #6913
Looks fixed in: #7107

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