Open
Description
TypeScript Version: 3.4.3
Search Terms:
ServiceWorkerRegistration Update
Code
// A *self-contained* demonstration of the problem follows...
// Test this by running `tsc` on the command-line, rather than through another build tool such as Gulp, Webpack, etc.
let isUpdating: boolean;
navigator.serviceWorker.getRegistration().then(sw => {
sw.update().then(result => {
if (result.installing || result.waiting) {
isUpdating = true;
}
});
});
Expected behavior:
result
is of type ServiceWorkerRegistration
and result.installing
and result.waiting
are valid.
https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/update
Actual behavior:
result
is of type void and tsc gives errors
error TS2339: Property 'installing' does not exist on type 'void'.
error TS2339: Property 'waiting' does not exist on type 'void'.
Related Issues:
#17590