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

preloaded module missing cookies. #4453

Closed
4 tasks done
tengmaoqing opened this issue Jul 31, 2021 · 5 comments
Closed
4 tasks done

preloaded module missing cookies. #4453

tengmaoqing opened this issue Jul 31, 2021 · 5 comments

Comments

@tengmaoqing
Copy link
Contributor

Clear and concise description of the problem

The preloaded module may missing cookies in some browser. (For example:windows QQ browser 10.8 4405 chromium70.0.3538.25).

Reproduction

pic1

the request header without cookies in file that name is vendor.9ed1d783.js.
image

pic2

This request carries a cookie in file that name is vendor.9ed1d783.js when i added crossorigin.
image
image

Suggested solution

Added the crossorigin attribute to the modulepreload link tag
#4408

Alternative

No response

Additional context

No response

Validations

@haoqunjiang
Copy link
Member

The issue is an old Chrome bug.
https://bugs.chromium.org/p/chromium/issues/detail?id=849101

@haoqunjiang
Copy link
Member

I don't think Vite should add the crossorigin attribute by default just to work around the Chrome bug.

But we can add the crossorigin attribute to modulepreload tags if there's a crossorigin attribute on the entry script tag.

@tengmaoqing
Copy link
Contributor Author

there's a crossorigin attribute on the entry script tag

em. Vite added the crossorigin attribute by default on the entry script tag. But modulepreload didn’t.

This causes the problem.

@sapphi-red
Copy link
Member

Looks like this commit introduced that change.
e6f7fba#diff-89bae1df62862bb7f4a03d82a1e9cbf4ac6d0c042f21fbbacb0a2238bd050042R285

@bluwy
Copy link
Member

bluwy commented Jun 25, 2022

Closing as #4408 is merged

@bluwy bluwy closed this as completed Jun 25, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jul 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants