-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Service Worker "import sentry-release-injection" error when loading page #132
Comments
who is injecting that import and when? The problem is about sw build, try using Using |
@userquin I am trying to use I have instructions on how to reproduce in readme. https://github.com/MaxWeisen/vite-pwa-sentry-plugin-issue Thank you! |
So, the problem is only in dev (?), I'm going to check if registering the sw using type module works. Running build script the sw generated without that import. |
I have not tried this outside of dev. |
try building your app and running the preview script or |
@userquin So something needs to change within @sentry/vite-plugin? Or we cannot use @sentry/vite-plugin with vite-pwa/nuxt? |
I have no idea why sentry release adding the import, it seems that match this, and so adding it: Shouldn't be applied only in build? I mean, the unplugin plugin (vite) being added without any apply option, just with enforce pre: |
upps, using filename (removes the query param):
|
You can but using |
@userquin What does your custom SW file look like? How are you handling the "revisions" cache? |
I'll send you a PR to your repro and so you can see the changes, I'm finishing some tests like build the sw. |
@MaxWeisen in dev there is no offline support, the manifest entries will have only the navigate fallback or |
@MaxWeisen MaxWeisen/vite-pwa-sentry-plugin-issue#1 We'll need to prerender the navigate fallback. Since your repo not using pages... update changes properly. Remove |
I forgot to mention I also added the sentry plugin to the build, you can remove it: just remove this entry https://github.com/MaxWeisen/vite-pwa-sentry-plugin-issue/pull/1/files#diff-5977891bf10802cdd3cde62f0355105a1662e65b02ae4fb404a27bb0f5f53a07R47-R55 |
You can check any custom sw in the vite pwa plugin examples folder or here in nuxt playground: check also a working (production) example with some runtime caching entries and some exclusions like api calls (also with some advanced features like push notifications, push notification clicks and web shared target api): https://github.com/elk-zone/elk/blob/main/service-worker/sw.ts |
@userquin Thank you for all the resources and help. This is great. |
getsentry/sentry-javascript-bundler-plugins#460
@ArnauKokoro posted this issue in the getsentry/sentry-javascript-bundler-plugins repo.
Within this issue @iforst writes the following:
getsentry/sentry-javascript-bundler-plugins#460 (comment)
Here's what my generated service worker looks like:
The last line
;import "/_nuxt/@id/__x00__sentry-release-injection-file";
is causing the error:And idea on how we can get vite-pwa to work with Sentry Vite plugin?
The text was updated successfully, but these errors were encountered: