Skip to content

Web Workers don't work when enforcing Trusted Types #15702

@jprinaldi

Description

@jprinaldi

Describe the bug

When enforcing Trusted Types with the require-trusted-types-for CSP directive, Web Workers stop working and no existing Trusted Type policy can make them work, namely svelte-trusted-html and svelte-trusted-url.

Reproduction

https://stackblitz.com/edit/sveltejs-kit-template-default-pvqfrgpg

Logs

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 22.22.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.8.2 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @sveltejs/adapter-auto: 7.0.1 => 7.0.1 
    @sveltejs/kit: 2.57.1 => 2.57.1 
    @sveltejs/vite-plugin-svelte: 6.2.4 => 6.2.4 
    svelte: 5.55.3 => 5.55.3 
    vite: 7.2.2 => 7.2.2

Severity

blocking an upgrade

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions