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

ReferenceError: Observable is not defined after upgrade to 11.1.0 #19852

Closed
rhutchison opened this issue Jan 22, 2021 · 5 comments
Closed

ReferenceError: Observable is not defined after upgrade to 11.1.0 #19852

rhutchison opened this issue Jan 22, 2021 · 5 comments

Comments

@rhutchison
Copy link

🐞 bug report

Affected Package

The issue is caused by package @angular/core

Is this a regression?

Yes, the previous version in which this bug was not present was: 11.0.9

Description

After upgrading to 11.1.0, the app will build, and tests pass, but getting reference errors when opening the app in a browser.

🔬 Minimal Reproduction

This is a larger/complex app. I checked with community members in #update-party on discord and at least one other community member is seeing a similar issue. I'll update when I nail down minimal reproduction.

🔥 Exception or Error


Uncaught ReferenceError: Observable is not defined
    at Module.LwNI (auth.facade.ts:19)
    at __webpack_require__ (bootstrap:84)
    at Module.WmHz (index.ts:1)
    at __webpack_require__ (bootstrap:84)
    at Module.py0R (base-login.component.ts:2)
    at __webpack_require__ (bootstrap:84)
    at Module.4pNn (index.ts:1)
    at __webpack_require__ (bootstrap:84)
    at Module.N3Wk (index.ts:1)
    at __webpack_require__ (bootstrap:84)

🌍 Your Environment

Angular Version:


Angular CLI: 11.1.0
Node: 14.15.3
OS: win32 x64

Angular: 11.1.0
... animations, cdk, cli, common, compiler, compiler-cli, core
... elements, forms, language-service, material
... material-moment-adapter, platform-browser
... platform-browser-dynamic, router
Ivy Workspace: 

Package                          Version
----------------------------------------------------------
@angular-devkit/architect        0.1100.7
@angular-devkit/build-angular    0.1101.0
@angular-devkit/core             11.1.0
@angular-devkit/schematics       11.1.0
@angular-devkit/schematics-cli   0.1101.0
@angular/flex-layout             11.0.0-beta.33
@schematics/angular              11.1.0
@schematics/update               0.1101.0
rxjs                             6.6.3
typescript                       4.1.3

Anything else relevant?
I've removed node_modules/reinstalled more than once. I put mouse on head. I can confirm it runs fine in 11.0.9 and breaks in 11.1.0-next.0.

11.0.9

√ Browser application bundle generation complete.

Initial Chunk Files                                                                               | Names                                                                                          |      Size
vendor.js                                                                                         | vendor                                                                                         |   6.20 MB
main.js                                                                                           | main                                                                                           |   3.33 MB
polyfills.js                                                                                      | polyfills                                                                                      | 478.66 kB
styles.css, styles.js                                                                             | styles                                                                                         | 402.14 kB
runtime.js                                                                                        | runtime                                                                                        |   9.49 kB

                                                                                                  | Initial Total                                                                                  |  10.40 MB

Lazy Chunk Files                                                                                  | Names                                                                                          |      Size
products-products-module.js                                                                       | products-products-module                                                                       |   2.40 MB
default~presentations-presentations-module~products-products-module~suppliers-suppliers-module.js | default~presentations-presentations-module~products-products-module~suppliers-suppliers-module |   2.23 MB
suppliers-suppliers-module.js                                                                     | suppliers-suppliers-module                                                                     | 264.22 kB
presentations-presentations-module.js                                                             | presentations-presentations-module                                                             | 127.06 kB
default~presentations-presentations-module~products-products-module.js                            | default~presentations-presentations-module~products-products-module                            |  38.79 kB
common.js                                                                                         | common                                                                                         |   5.34 kB

Build at: 2021-01-22T16:06:31.879Z - Hash: 6b873947194acf3d9ae4 - Time: 28561ms

11.1.0-next.0

√ Browser application bundle generation complete.

Initial Chunk Files                                                                               | Names                                                                                          |      Size
vendor.js                                                                                         | vendor                                                                                         |   6.20 MB
main.js                                                                                           | main                                                                                           |   3.19 MB
polyfills.js                                                                                      | polyfills                                                                                      | 469.15 kB
styles.css, styles.js                                                                             | styles                                                                                         | 403.01 kB
runtime.js                                                                                        | runtime                                                                                        |   9.59 kB

                                                                                                  | Initial Total                                                                                  |  10.25 MB

Lazy Chunk Files                                                                                  | Names                                                                                          |      Size
products-products-module.js                                                                       | products-products-module                                                                       |   2.35 MB
default~products-products-module~suppliers-suppliers-module.js                                    | default~products-products-module~suppliers-suppliers-module                                    |   2.14 MB
suppliers-suppliers-module.js                                                                     | suppliers-suppliers-module                                                                     | 257.29 kB
presentations-presentations-module.js                                                             | presentations-presentations-module                                                             | 117.86 kB
default~presentations-presentations-module~products-products-module~suppliers-suppliers-module.js | default~presentations-presentations-module~products-products-module~suppliers-suppliers-module |  92.40 kB
default~presentations-presentations-module~products-products-module.js                            | default~presentations-presentations-module~products-products-module                            |  35.68 kB

Build at: 2021-01-22T16:14:21.565Z - Hash: 22a04fe1e8eeb1b8667f - Time: 32304ms

11.1.0

√ Browser application bundle generation complete.

Initial Chunk Files                                                                               | Names                                                                                          |      Size
vendor.js                                                                                         | vendor                                                                                         |   6.19 MB
main.js                                                                                           | main                                                                                           |   3.24 MB
polyfills.js                                                                                      | polyfills                                                                                      | 469.15 kB
styles.css, styles.js                                                                             | styles                                                                                         | 403.01 kB
runtime.js                                                                                        | runtime                                                                                        |   9.59 kB

                                                                                                  | Initial Total                                                                                  |  10.29 MB

Lazy Chunk Files                                                                                  | Names                                                                                          |      Size
products-products-module.js                                                                       | products-products-module                                                                       |   2.32 MB
default~products-products-module~suppliers-suppliers-module.js                                    | default~products-products-module~suppliers-suppliers-module                                    |   2.14 MB
suppliers-suppliers-module.js                                                                     | suppliers-suppliers-module                                                                     | 257.29 kB
presentations-presentations-module.js                                                             | presentations-presentations-module                                                             | 117.86 kB
default~presentations-presentations-module~products-products-module~suppliers-suppliers-module.js | default~presentations-presentations-module~products-products-module~suppliers-suppliers-module |  92.40 kB
default~presentations-presentations-module~products-products-module.js                            | default~presentations-presentations-module~products-products-module                            |  35.68 kB

Build at: 2021-01-22T15:55:45.907Z - Hash: b58c1d277cbb552f1663 - Time: 26784ms
@JoostK JoostK transferred this issue from angular/angular Jan 22, 2021
@JoostK
Copy link
Member

JoostK commented Jan 22, 2021

This is being fixed in #19841.

@petebacondarwin
Copy link
Contributor

Duplicate of #19839

@petebacondarwin petebacondarwin marked this as a duplicate of #19839 Jan 22, 2021
@rhutchison
Copy link
Author

Thanks @JoostK @petebacondarwin

@clydin
Copy link
Member

clydin commented Jan 22, 2021

One other item to note is the emitDecoratorMetadata TypeScript configuration option. This TypeScript option is responsible for the initial creation of the code that is being broken. It is recommended that the option no longer be used in Angular applications unless specifically needed by a third party library or custom application code (this is rare). The option has known flaws that can cause temporal dead zone related errors at runtime when targeting ES2015+.

@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 Feb 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants