Skip to content
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 files do not get chunked #16707

Closed
7 tasks done
CatchABus opened this issue May 17, 2024 · 2 comments
Closed
7 tasks done

Service worker files do not get chunked #16707

CatchABus opened this issue May 17, 2024 · 2 comments
Labels
duplicate This issue or pull request already exists

Comments

@CatchABus
Copy link

Describe the bug

Service workers do not get chunked like web workers.

In few words, sw file does not get chunked:

navigator.serviceWorker.register(new URL('sw.js', import.meta.url), {
  type: 'module',
  scope: '/',
});

but if used for a web-worker, it does:

let worker = new Worker(new URL('sw.js', import.meta.url));

Reproduction

https://stackblitz.com/edit/vitejs-vite-pw6vnq?file=main.js

Steps to reproduce

  • Run npm run build
  • Check dist/assets folder and you'll notice the chunk for sw.js is missing

System Info

System:
    OS: Linux 6.5 Ubuntu 20.04.3 LTS (Focal Fossa)
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
    Memory: 8.76 GB / 15.30 GB
    Container: Yes
    Shell: 5.0.17 - /bin/bash

npmPackages:
    @sveltejs/vite-plugin-svelte: ^3.1.0 => 3.1.0 
    @testing-library/jest-dom: ^6.4.5 => 6.4.5 
    @testing-library/svelte: ^5.1.0 => 5.1.0 
    @vitest/coverage-v8: ^1.6.0 => 1.6.0 
    eslint-plugin-svelte: ^2.35.1 => 2.35.1 
    jsdom: ^24.0.0 => 24.0.0 
    svelte: ^4.2.12 => 4.2.12 
    svelte-preprocess: ^5.1.3 => 5.1.3 
    svelte-spa-router: ^4.0.1 => 4.0.1 
    svelte-tags-input: ^6.0.0 => 6.0.0 
    vite: ^5.2.11 => 5.2.11 
    vite-plugin-dynamic-import: ^1.5.0 => 1.5.0 
    vitest: ^1.6.0 => 1.6.0

Used Package Manager

npm

Logs

No response

Validations

Copy link

stackblitz bot commented May 17, 2024

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@sapphi-red
Copy link
Member

Duplicate of #2248

@sapphi-red sapphi-red marked this as a duplicate of #2248 May 17, 2024
@sapphi-red sapphi-red closed this as not planned Won't fix, can't repro, duplicate, stale May 17, 2024
@sapphi-red sapphi-red added duplicate This issue or pull request already exists and removed pending triage labels May 17, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jun 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants