Open ArnauKokoro opened 5 months ago
can you add type: 'module'
in PWA devOptions
entry? Since sentry is adding an import to the sw in dev mode, this plugin doesn't include anything in the sw (it is build by workbox-build module):
;import "/@id/__x00__sentry-release-injection-file";
Adding type: 'module'
on VitePWA devOptions
I'm having same error on dev mode.
Thanks!
can you provide a minimal repro?
Just running yarn dev
This is what chrome console says:
Uncaught SyntaxError: Cannot use import statement outside a module (at dev-sw.js?dev-sw:96:2)
And these are the lines of dev-sw.js
:
define(['./workbox-9637eeee'], (function(workbox) {
'use strict';
self.addEventListener('message', event=>{
if (event.data && event.data.type === 'SKIP_WAITING') {
self.skipWaiting();
}
}
);
/**
* The precacheAndRoute() method efficiently caches and responds to
* requests for URLs in the manifest.
* See https://goo.gl/S9QRab
*/
workbox.precacheAndRoute([{
"url": "index.html",
"revision": "0.fp20qtanrkg"
}], {});
workbox.cleanupOutdatedCaches();
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"),{
allowlist: [/^\/$/]
}));
}
));
//# sourceMappingURL=sw.js.map
;import "/@id/__x00__sentry-release-injection-file";
//# sourceMappingURL=data:application/json;base64;xxx
Any updates here? @ArnauKokoro have you found a solution?
Hi @yuri-ellfort,
When is development mode i'm setting globPatterns to [].
sentry an pwa plugin or pwa plugin integrations cannot be used with generateSW
strategy, check: https://github.com/vite-pwa/nuxt/issues/132
Hi,
I'm addressing this issue to you.
https://github.com/getsentry/sentry-javascript-bundler-plugins/issues/460
Thanks!