Skip to content
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

Build Optimizer breaks Ivy Apps using platformBrowserDynamic #13261

Closed
alan-agius4 opened this issue Dec 21, 2018 · 4 comments
Closed

Build Optimizer breaks Ivy Apps using platformBrowserDynamic #13261

alan-agius4 opened this issue Dec 21, 2018 · 4 comments

Comments

@alan-agius4
Copy link
Collaborator

alan-agius4 commented Dec 21, 2018

Bug Report or Feature Request (mark with an x)

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

Command (mark with an x)

- [ ] new
- [x] build
- [x] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

Angular CLI: 7.2.0-rc.0
Node: 11.0.0
OS: win32 x64
Angular: 7.2.0-rc.0
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.12.0-rc.0
@angular-devkit/build-angular     0.12.0-rc.0
@angular-devkit/build-optimizer   0.12.0-rc.0
@angular-devkit/build-webpack     0.12.0-rc.0
@angular-devkit/core              7.2.0-rc.0
@angular-devkit/schematics        7.2.0-rc.0
@ngtools/webpack                  7.2.0-rc.0
@schematics/angular               7.2.0-rc.0
@schematics/update                0.12.0-rc.0
rxjs                              6.3.3
typescript                        3.2.2
webpack                           4.23.1

Repro steps

When using ngtsc, together with the usual platformBrowserDynamic bootstrapping code causes a runtime error.

git  clone https://github.com/alan-agius4/ivy-build-optimizer-issue.git
npm i
node_modules\.bin\ivy-ngcc
ng serve --prod

The log given by the failure

Runtime error

main.ts:12 Error: No ErrorHandler. Is platform module (BrowserModule) included?
    at core.js.pre-build-optimizer.js:17333
    at n.invoke (zone.js.pre-build-optimizer.js:388)
    at Object.onInvoke (core.js.pre-build-optimizer.js:16856)
    at n.invoke (zone.js.pre-build-optimizer.js:387)
    at t.run (zone.js.pre-build-optimizer.js:138)
    at t.run (core.js.pre-build-optimizer.js:16770)
    at t.bootstrapModuleFactory (core.js.pre-build-optimizer.js:17328)
    at core.js.pre-build-optimizer.js:17368
    at n.invoke (zone.js.pre-build-optimizer.js:388)
    at t.run (zone.js.pre-build-optimizer.js:138)

Desired functionality

No Error.

Mention any other details that might be useful

When turning off BuildOptimizer there are no runtime errors.

@alan-agius4
Copy link
Collaborator Author

alan-agius4 commented Dec 21, 2018

The root cause seems to be caused by scrub file transformer in build optimizer.

Will continue looking into it in the coming days

@alan-agius4
Copy link
Collaborator Author

Blocked by angular/angular#27841

@alan-agius4
Copy link
Collaborator Author

Closing as this issue is from the compiler and there is a fix for it angular/angular#27848

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant