Skip to content

sentry-vite-plugin: enable source mapping for Web Worker source files #755

@mattico

Description

@mattico

I'm using vite and the sentryVitePlugin. My app uses web workers which are imported with new Worker(new URL('./workerLineStats.ts', import.meta.url), { type: 'module' });. Vite understands that and outputs workerLineStats-LjpNa9wZ.js and a .map file.

I'm using DebugIDs for the main app, but those don't work for the web worker files. The debug output from sentry-vite-plugin includes:

[sentry-vite-plugin] Debug: Could not determine debug ID from bundle. This can happen if you did not clean your output folder before installing the Sentry plugin. File will not be source mapped: /workspaces/data-portal/apps/frontend/build/assets/workers/OverallStats.worker-BPsL_pTV.js

Alternatively, uploadLegacySourcemaps could be used for the web worker files, but I'm having trouble making that work as well, see below.


Edit: generalized issue to the root problem of sourcemaps for workers in Vite, rather than the specific suggested fix of uploadLegacySourcemaps globs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions