Skip to content

SvelteKit2 + Vite 5 no longer gzip encodes when using vite preview #11368

@HummingMind

Description

@HummingMind

Describe the bug

SvelteKit2 + Vite 5 no longer gzip encodes when using vite preview. Used to work with SK1 and Vite4/Vite5. No longer works after upgrading to SK2.

image

The bytes transferred is over double what it should be, since there is no gzip compression for the JavaScript assets.

It's not an issue for production, but it is a DX issue for local development, as I always preview to get an idea on the bundle size of what would go "over-the-wire" in production.

  kit: {
    adapter: adapter({ precompress: true }),
  },

The precopress setting is in the config.

Thank you!

Reproduction

Set up a new SK2 project or migrate an existing project. Use the static adapter.
Build. Preview.

Logs

No response

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (32) x64 13th Gen Intel(R) Core(TM) i9-13980HX
    Memory: 22.10 GB / 31.62 GB
  Binaries:
    Node: 21.4.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.2.5 - C:\Program Files\nodejs\npm.CMD
    pnpm: 8.7.6 - ~\AppData\Local\pnpm\pnpm.CMD
  Browsers:
    Edge: Chromium (120.0.2210.77)
    Internet Explorer: 11.0.22621.1
  npmPackages:
    @sveltejs/adapter-static: 3.0.0 => 3.0.0 
    @sveltejs/kit: 2.0.0 => 2.0.0 
    @sveltejs/vite-plugin-svelte: 3.0.1 => 3.0.1 
    svelte: 5.0.0-next.25 => 5.0.0-next.25 
    vite: 5.0.10 => 5.0.10

Severity

annoyance

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