Skip to content

@sentry/vite-plugin conflicts with vite-plugin-pwa #239

@dcramer

Description

@dcramer

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/react

SDK Version

7.51.0

Framework Version

No response

Link to Sentry event

No response

SDK Setup

No response

Steps to Reproduce

Add Sentry's vite plugin/suggested flow to this example:

https://github.com/vite-pwa/vite-plugin-pwa/tree/main/examples/react-router/src

Expected Result

The expected result is that it works. Can we remove this from the dang github issue template?

Actual Result

The registerSW.js that appears generated ends up with an invalid statement injected from Sentry:

if ('serviceWorker'in navigator)
    navigator.serviceWorker.register('/dev-sw.js?dev-sw', {
        scope: '/',
        type: 'classic'
    });
import "/@fs/home/dcramer/src/peated/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js?v=ca9b2c4c";
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjpudWxsLCJzb3VyY2VzIjpbbnVsbF0sInNvdXJjZXNDb250ZW50IjpbbnVsbF0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBIn0=

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions