-
Notifications
You must be signed in to change notification settings - Fork 12k
ES2015 target fails to serve #7797
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
Comments
@mark-buer use |
@prabh-62 Thanks! |
It's unintended that |
Ok I have bad news about this, it seems that Angular itself on JIT does not work with a
So on the CLI side the best we can do is look at ways to alleviate this. |
@filipesilva That is odd. If I use CLI 1.4.3 it works, but 1.5.0.beta-1 doesn't with the same angular version. |
It's because #7610 added real es2015 support to the CLI. 1.4.x didn't truly support es2015. |
I see that the workaround for |
I don't have a real solution yet but would like to mention a workaround: having multiple applications (https://github.com/angular/angular-cli/wiki/stories-multiple-apps), with different tsconfigs. This way you can use one for prod builds and another for dev builds. I know it's not pretty but while JIT doesn't support es2015 there isn't a lot that can be done for a real solution. |
Hi! npm i -g @angular/[email protected]
ng new esnext
# Set tsconfig.json target value as "es2015"
ng build --prod The web app crash with the following error ERROR TypeError: Cannot read property '_moduleDoBootstrap' of undefined
at e.donePromise.then (main.687bb3d77a61372fe0a8.bundle.js:1)
at e.invoke (polyfills.ad37cd45a71cb38eee76.bundle.js:1)
at Object.onInvoke (main.687bb3d77a61372fe0a8.bundle.js:1)
at e.invoke (polyfills.ad37cd45a71cb38eee76.bundle.js:1)
at r.run (polyfills.ad37cd45a71cb38eee76.bundle.js:1)
at polyfills.ad37cd45a71cb38eee76.bundle.js:1
at e.invokeTask (polyfills.ad37cd45a71cb38eee76.bundle.js:1)
at Object.onInvokeTask (main.687bb3d77a61372fe0a8.bundle.js:1)
at e.invokeTask (polyfills.ad37cd45a71cb38eee76.bundle.js:1)
at r.runTask (polyfills.ad37cd45a71cb38eee76.bundle.js:1) |
@ghoullier For now you can workaround it by disabling build optimizer |
I have the same issue as @ghoullier in my production build. |
@blub0hr You'll get bigger bundle size ~10-30% depending on the application. |
any updates?? |
Until Angular itself support ES2015 on JIT, what you can do is always run your ES2015 app in AOT mode ( |
I have a problem when I run ng build: |
I have tried this with the latest CLI and Angular 7 and it looks like it's working. 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.
Repro steps.
The log given by the failure.
Exception observed in browser console:
Mention any other details that might be useful.
#7610 made it so that es2015 targets are supported (yay). It achieved that for production builds, but doesn't seem usable since serve builds are now broken!
Within that PR (#7610), if the changes to
packages/@angular/cli/models/webpack-configs/common.ts
are instead performed entirely withinpackages/@angular/cli/models/webpack-configs/production.ts
,serve
andbuild
work as I expect them to.The text was updated successfully, but these errors were encountered: