You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Aliased imports from a barrel file only work in development #7066
The import works fine in development with ng serve, however whilst ng build --prod --aot succeeds, the resulting code does not run due to an error TypeError: 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.
import { foo as exampleFoo } from './example/foo';
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.
main.b771427faeac57797e03.bundle.js:1 Uncaught TypeError: Cannot read property '__extends' of undefined
at main.b771427faeac57797e03.bundle.js:1
at Object.x35b (main.b771427faeac57797e03.bundle.js:1)
at o (inline.c7e7d2e66b46b1ee9e69.bundle.js:1)
at Object.0 (main.b771427faeac57797e03.bundle.js:1)
at o (inline.c7e7d2e66b46b1ee9e69.bundle.js:1)
at window.webpackJsonp (inline.c7e7d2e66b46b1ee9e69.bundle.js:1)
at main.b771427faeac57797e03.bundle.js:1
code:
export * from './authenticator/company.model';
export * from './authenticator/user.model';
export * from './authenticator/person.model';
import { Company , Person, User } from '@vamos-webapp/models';
I'm sorry, but we can't reproduce the problem following the instructions you provided.
Remember that we have a large number of issues to resolve, and have only a limited amount of time to reproduce your issue.
Short, explicit instructions make it much more likely we'll be able to reproduce the problem so we can fix it.
A good way to make a minimal repro is to create a new app via ng new repro-app and adding the minimum possible code to show the problem. Then you can push this repository to github and link it here.
Activity
clydin commentedon Jul 20, 2017
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.
rubenmarcus commentedon Mar 21, 2018
still doesnt work in Angular 5.2.0
rubenmarcus commentedon Mar 21, 2018
main.b771427faeac57797e03.bundle.js:1 Uncaught TypeError: Cannot read property '__extends' of undefined
at main.b771427faeac57797e03.bundle.js:1
at Object.x35b (main.b771427faeac57797e03.bundle.js:1)
at o (inline.c7e7d2e66b46b1ee9e69.bundle.js:1)
at Object.0 (main.b771427faeac57797e03.bundle.js:1)
at o (inline.c7e7d2e66b46b1ee9e69.bundle.js:1)
at window.webpackJsonp (inline.c7e7d2e66b46b1ee9e69.bundle.js:1)
at main.b771427faeac57797e03.bundle.js:1
code:
import { Company , Person, User } from '@vamos-webapp/models';not working in ng serve --prod
jacobbullock commentedon May 4, 2018
Is this getting any attention? We are experiencing this in 5.2 as well
gnovotny commentedon Jun 7, 2018
Experiencing this as well in version 6
Problem goes away when you build with --build-optimizer=false
alan-agius4 commentedon Oct 10, 2018
I'm sorry, but we can't reproduce the problem following the instructions you provided.
Remember that we have a large number of issues to resolve, and have only a limited amount of time to reproduce your issue.
Short, explicit instructions make it much more likely we'll be able to reproduce the problem so we can fix it.
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
ng new repro-appand adding the minimum possible code to show the problem. Then you can push this repository to github and link it here.angular-automatic-lock-bot commentedon Sep 8, 2019
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.