Open zhangyuang opened 3 years ago
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.
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 sidethis.$style
value is exact valueBy 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