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

css modules InjectStyles bug in ssr #1866

Open
zhangyuang opened this issue Aug 22, 2021 · 1 comment
Open

css modules InjectStyles bug in ssr #1866

zhangyuang opened this issue Aug 22, 2021 · 1 comment

Comments

@zhangyuang
Copy link

zhangyuang commented Aug 22, 2021

Version

15.9.8

Reproduction link

https://github.com/zhangyuang/vue-loader-ssr-bug.git

Steps to reproduce

yarn && npm start

What is expected?

this.$style can be read the exact value in server and client side。

What is actually happening?

In server side this.$style value is {default : val}
In client side this.$style value is exact value


By read the source code, vue-loader must be used with vue-style-loader to avoid the problem.But i needn't use vue-style-loader。Maybe vue-loader should fix the case by itself

@samiconductor
Copy link

samiconductor commented Nov 15, 2021

Setting css-loader namedExport true solved a related problem for me.

UPD: Also found this option on mini css extract plugin esModules. Setting it to false did the trick and namedExport wasn't needed.

Hope that helps in case you're using either of those plugins.

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

2 participants