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

[Bug]: publicDir cannot serve files end with .gz #2630

Closed
SunriseFox opened this issue Jun 18, 2024 · 2 comments
Closed

[Bug]: publicDir cannot serve files end with .gz #2630

SunriseFox opened this issue Jun 18, 2024 · 2 comments
Labels
🐞 bug Something isn't working 🎯 upstream

Comments

@SunriseFox
Copy link

Version

System:
    OS: Linux 5.15 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
    CPU: (8) x64 Intel(R) Core(TM) i9-14900K
    Memory: 18.08 GB / 23.95 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  npmPackages:
    @rsbuild/core: ^0.7.8 => 0.7.8 
    @rsbuild/plugin-react: ^0.7.8 => 0.7.8

Details

If any file in public folder ends with .gz, the served file is not the same as the original file.

It might be related to these issues:
lukeed/sirv#158
vitejs/vite#12266

Reproduce link

newly created repo

Reproduce Steps

pnpm create rsbuild@latest
cd my-project
pnpm i
pnpm run dev

place some gz file like this into /public

access localhost:3000/excelize.wasm.gz and it's not the same file

$ sha1sum public/*
88c26b8f731b1e1aea24deb3655d3ab6f15ab84d  public/downloaded.gz
99c6ce68e9ca57920cb1a629f53ae88cef509e49  public/original.gz
@SunriseFox SunriseFox added the 🐞 bug Something isn't working label Jun 18, 2024
@chenjiahan
Copy link
Member

Maybe you can use output.copy as a workaround

@chenjiahan
Copy link
Member

This is an upstream issue, so I will close this issue and wait for sirv to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 🎯 upstream
Projects
None yet
Development

No branches or pull requests

2 participants