Skip to content

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

@skalidindi

Description

@skalidindi

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.

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