-
Notifications
You must be signed in to change notification settings - Fork 12k
-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Aliased imports from a barrel file only work in development #7066
Comments
Can you try with Angular 4.3? The AOT compiler received some major updates and may resolve your issue. Also, a production build automatically includes AOT. You don't need to add the "--aot" option. |
still doesnt work in Angular 5.2.0 |
main.b771427faeac57797e03.bundle.js:1 Uncaught TypeError: Cannot read property '__extends' of undefined code:
not working in ng serve --prod |
Is this getting any attention? We are experiencing this in 5.2 as well |
Experiencing this as well in version 6 Problem goes away when you build with --build-optimizer=false |
I'm sorry, but we can't reproduce the problem following the instructions you provided. If the problem persists, please open a new issue following our submission guidelines. A good way to make a minimal repro is to create a new app via |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug Report or Feature Request (mark with an
x
)Versions.
macOS Sierra
Repro steps.
Given an example file
example/foo.ts
Given an
example/index.ts
file such asWhen you have an aliased import such as
The import works fine in development with
ng serve
, however whilstng build --prod --aot
succeeds, the resulting code does not run due to an errorTypeError: Cannot read property 'apply' of undefined
If you change the import to not use the barrel file, the resulting compiled code is fine. i.e.
The log given by the failure.
When viewing the dist code:
TypeError: Cannot read property 'apply' of undefined
No errors during
ng build
.No errors when using
ng serve
.Desired functionality.
Consistency between development and production builds for imports.
Mention any other details that might be useful.
The text was updated successfully, but these errors were encountered: