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

SwPush breaks Angular on Safari - undefined is not an object (evaluating 'source.lift') #20407

Closed
maciejtreder opened this issue Nov 13, 2017 · 3 comments
Labels
area: service-worker Issues related to the @angular/service-worker package freq2: medium type: bug/fix

Comments

@maciejtreder
Copy link

maciejtreder commented Nov 13, 2017

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

When SwPush is injected in any service/component Safari complains with:

TypeError: undefined is not an object (evaluating 'source.lift') - map.js:46

Expected behavior

SwPush should not break Safari build (ie code should be ignored when service worker is not available)

Minimal reproduction of the problem with instructions

Inject SwPush into service/component.

Online example:
https://www.angular-universal-pwa.maciejtreder.com

github repo:
https://github.com/maciejtreder/angular-universal-pwa

Environment


Angular version: 5.0.0
rxjs: 5.5.2


Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [x] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: 8.5.0  
- Platform: Mac 


@jasonaden jasonaden added the area: service-worker Issues related to the @angular/service-worker package label Nov 14, 2017
@maciejtreder
Copy link
Author

Warkaround can be found in my Angular PWA starter:
https://github.com/maciejtreder/angular-universal-pwa
https://github.com/maciejtreder/angular-universal-pwa/pull/68/files#diff-ce9cfd30bd8965cf7bf8754af08e4825R21-R27

    private swPush: SwPush;

    constructor(private injector: Injector) {
        try {
            this.swPush = this.injector.get(SwPush);
        } catch (error) {
            // workaround for https://github.com/angular/angular/issues/20407
        }
    }

@alxhub
Copy link
Member

alxhub commented Dec 7, 2017

Fixed by 7cabaa0

@alxhub alxhub closed this as completed Dec 7, 2017
@alxhub alxhub removed this from Accepted in Service Worker Dec 7, 2017
@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 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: service-worker Issues related to the @angular/service-worker package freq2: medium type: bug/fix
Projects
None yet
Development

No branches or pull requests

3 participants