Skip to content

Build Optimizer breaks Ivy Apps using platformBrowserDynamic #13261

Closed

Description

@alan-agius4

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.

Activity

  1. modified the milestone: needsTriage on Dec 21, 2018
  2. modified the milestones: needsTriage, Backlog on Dec 21, 2018
  3. alan-agius4 commented on Dec 21, 2018

    @alan-agius4
    CollaboratorAuthor

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

    Will continue looking into it in the coming days

  4. alan-agius4 commented on Dec 27, 2018

    @alan-agius4
    CollaboratorAuthor
  5. alan-agius4 commented on Jan 8, 2019

    @alan-agius4
    CollaboratorAuthor

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

  6. angular-automatic-lock-bot commented on Sep 9, 2019

    @angular-automatic-lock-bot

    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.

  7. locked and limited conversation to collaborators on Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions