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?]: compressPublicAssets nitro config does not work #1569

Closed
2 tasks done
huseeiin opened this issue Jul 1, 2024 · 4 comments
Closed
2 tasks done

[Bug?]: compressPublicAssets nitro config does not work #1569

huseeiin opened this issue Jul 1, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@huseeiin
Copy link
Contributor

huseeiin commented Jul 1, 2024

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

when i enabled brotli it errors [5:22:22 PM] ERROR Cannot find module "/home/hussein/Desktop/solid-project/.output/server/index.mjs" from "/home/hussein/Desktop/solid-project/node_modules/vinxi/bin/cli.mjs"

Expected behavior 🤔

No response

Steps to reproduce 🕹

Steps:

Context 🔦

No response

Your environment 🌎

No response

@huseeiin huseeiin added the bug Something isn't working label Jul 1, 2024
@mdynnl
Copy link

mdynnl commented Jul 2, 2024

did you forget to include steps? anyway, can't seem to reproduce this.

  1. both brotli and gzip are enabled by default and working.
  2. compressPublicAssets: false disables both.
  3. compressPublicAssets: { gzip: false, brotli: false } disables each respectively.

tested with solid-start/basic template

├── @solidjs/meta@0.29.4
├── @solidjs/router@0.13.6
├── @solidjs/start@1.0.2
├── solid-js@1.8.18
└── vinxi@0.3.12

@huseeiin
Copy link
Contributor Author

huseeiin commented Jul 3, 2024

did you forget to include steps? anyway, can't seem to reproduce this.

1. both `brotli` and `gzip` are enabled by default and working.

2. `compressPublicAssets: false` disables both.

3. `compressPublicAssets: { gzip: false, brotli: false }` disables each respectively.

tested with solid-start/basic template

├── @solidjs/meta@0.29.4
├── @solidjs/router@0.13.6
├── @solidjs/start@1.0.2
├── solid-js@1.8.18
└── vinxi@0.3.12

with the basic example i'm only seeing gzip in the network tab
image

@mdynnl
Copy link

mdynnl commented Jul 3, 2024

i believe this is expected because the response can only be served in one of a few encoding formats specified by Accept-Encoding request header. you probably should see what you're expecting if you modified the request headers somehow to accept brotli.

Screenshot 2024-07-03 at 20 03 31

some info that might be useful https://nitro.unjs.io/config#compresspublicassets

If enabled, Nitro will generate a pre-compressed (gzip and/or brotli) version of supported types of public assets and prerendered routes larger than 1024 bytes into the public directory. The best compression level is used. Using this option you can support zero overhead asset compression without using a CDN.

@huseeiin
Copy link
Contributor Author

huseeiin commented Jul 3, 2024

its a bun issue.

@huseeiin huseeiin closed this as completed Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants