Skip to content

f.Observable.defer is not a function --build-optimizer #7114

Closed

Description

@elvirdolic

Bug Report or Feature Request (mark with an x)

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

Versions.

@angular/cli: 1.3.0-rc.0
node: 8.0.0
os: win32 x64

Repro steps.

npm --prod --build-optimizer

Build is working without any issues

Starting the app I got a runtime exception

main.533cf46….bundle.js:1 ERROR Error: Uncaught (in promise): TypeError: f.Observable.defer is not a function
TypeError: f.Observable.defer is not a function
    at e.W4CS.t.request (main.533cf46….bundle.js:1)
    at e.W4CS.t.requestHelper (main.533cf46….bundle.js:1)
    at e.W4CS.t.get (main.533cf46….bundle.js:1)
    at e.get (main.533cf46….bundle.js:1)

angular: 4.3.1
angular-material: 2.0.0-beta.8

using it without --build-optimizer it works without any issues

the defer is comming from angular-jwt

https://github.com/auth0/angular2-jwt/blob/435b8fc48415e57da40a788777a53ba37c906620/angular2-jwt.ts

but it's imported correctly there. I'm not sure why it's not working.

The log given by the failure.

Desired functionality.

Mention any other details that might be useful.

Activity

  1. scttcper commented on Jul 24, 2017

    @scttcper
    Contributor

    getting same issue with 1.3.0-rc.1 using same angular2-jwt

    Edit: worth checking out the angular2-jwt beta that uses interceptors and the new 4.3 http lib. No more use of defer either.

  2. filipesilva commented on Jul 28, 2017

    @filipesilva
    Contributor

    This is indeed a problem with the build optimizer, related to angular/devkit#51. Will fix.

  3. self-assigned this
    on Jul 28, 2017
  4. added
    P1Impacts a large percentage of users; if a workaround exists it is partial or overly painful
    on Jul 28, 2017
  5. added a commit that references this issue on Aug 3, 2017
    7e31be6
  6. added 2 commits that reference this issue on Aug 3, 2017
    76779b1
    aa0a59b
  7. added a commit that references this issue on Apr 23, 2018
    d8d4e89
  8. angular-automatic-lock-bot commented on Sep 7, 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.

  9. locked and limited conversation to collaborators on Sep 7, 2019
  10. added a commit that references this issue on May 29, 2026
    d700c0e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1Impacts a large percentage of users; if a workaround exists it is partial or overly painfulseverity3: brokentype: bug/fix

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions