-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Typed.js breaks @angular/pwa #401
Comments
This is very strange. I'm not super familiar with how the type definitions file works w/ angular cli, but if deleting it fixes the build there must be some kind of conflict. Do you think you could fork and investigate with your project? Maybe due to the definitions file, the AOT is expecting to be imported differently than |
Hi @mattboldt, So it turns out, it's not type definition. It's actually due to how setTimeout / setInterval is unreliable in ServiceWorkers used by PWA w3c/ServiceWorker#838. The service worker actually works and will register itself AFTER typed.js animation finish.
I think it's not a bug by typed.js, rather than with how setTimeout and interval interact with serviceworker, i'm closing the issue. However perhaps it would be nice if you can add the fix to the readme. :) |
Hey @rezonjov when I import like Can you guide me the correct way to import typedjs @mattboldt |
I have the same problem as @bibek687 any solution? |
Description
When used in Angular 6/7 with PWA
ng add @angular/pwa
installed, typed.js breaks the service worker, the service worker is not detected by the browser.Demo
You can pull https://github.com/rezonjov/typed-angular, I've setup all the necessary plugin.
Check
src/app/app.component.ts
Steps to Reproduce
new Typed
and run ng build --prod againExpected behavior: ngsw-worker.js is detected and service worker works as expected
Actual behavior: ngsw-worker.js is not detected
Reproduces how often: always
Additional Information
Temporary Solution
I deleted index.d.ts and use the importimport * as Typed from 'typed.js'
for the time being which works well with Angular PWA. Somehow the type definition is causing the issue, it might be related to how AOT works in Angular.The text was updated successfully, but these errors were encountered: