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 #100

Open
skalidindi opened this issue Feb 16, 2024 · 0 comments

Comments

@skalidindi
Copy link

skalidindi commented Feb 16, 2024

Minimal Reproduction Repo: https://github.com/skalidindi/vite-vue2-bug

My repo has a very basic Vue project with App.vue containing some css code.

When you run the project in dev mode and inspect the network tab, you notice document requests such as for App's css i.e

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

This properly returns javascript as expected.

However, if the order of the query params changes then the output is different and instead invalidly returns the parsed css such as

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

This behavior is causing me issues because I need to run Vite through a server which proxies all requests. This middle layer sometimes reorders the query params. And as mentioned above when the query params are reordered, the returned result is not what is expected and thus cause browser syntax errors.

The result when making a call to a URL should always return the same result given the same url even if the query param order has changed.

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

No branches or pull requests

1 participant