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

Vite dev mode, loading css files is not consistent if order of query params is changed #357

Open
8 of 9 tasks
skalidindi opened this issue Feb 16, 2024 · 0 comments
Open
8 of 9 tasks

Comments

@skalidindi
Copy link

skalidindi commented Feb 16, 2024

Related plugins

Describe the bug

I am trying to run a vite dev mode in an environment where order of query params can change in a middle layer which is out of my control but Vite's output seems to be dependent on the order of its query params when it shouldn't be the case.

Note: This happens in Vue 2's plugin as well.

Reproduction

https://github.com/skalidindi/vue3-vite-bug

Steps to reproduce

Run the following in the codebase

npm install
npm run dev

Then visit
http://localhost:3000/src/App.vue?vue&type=style&index=0&scoped=7a7a37b1&lang.css
This returns the right output of javascript

However, change the order of query params in this url and visit that url for example

http://localhost:3000/src/App.vue?vue&type=style&lang.css&index=0&scoped=7a7a37b1

This instead results in parsed css which the browser does not like because the file type from the request is document JS.

System Info

System:
    OS: macOS 14.2
    CPU: (12) arm64 Apple M2 Pro
    Memory: 72.94 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.11.0 - ~/.local/state/fnm_multishells/78767_1685589184986/bin/node
    Yarn: 1.22.21 - /opt/homebrew/bin/yarn
    npm: 10.4.0 - ~/.local/state/fnm_multishells/78767_1685589184986/bin/npm
    bun: 1.0.25 - ~/.bun/bin/bun
  Browsers:
    Brave Browser: 121.1.62.156
    Safari: 17.2
  npmPackages:
    @vitejs/plugin-vue: ^5.0.3 => 5.0.4 
    vite: ^5.1.0 => 5.1.3

Used Package Manager

npm

Logs

N/A

Validations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant