vuejs / vue-style-loader

💅 vue style loader module for webpack

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Client hydration duplicates <style> tags

dsine-de opened this issue · comments

Do you want to request a feature or report a bug?
Report a bug.
If this is a question, I'm sorry - please close this issue then. I'm thankful for links to other resources where this issue has been discussed already.

What is the current behavior?
Client hydration with Vue Server Side Rendering duplicates all the <style> tags. The server side rendered tags have a data-vue-ssr-id attribute.

If the current behavior is a bug, please provide the steps to reproduce.
Relevant part of my webpack.config.js:

module: {
	rules: [{
		test: /\.vue$/,
		use: [{
			loader: 'vue-loader',
			options: {
				extractCSS: process.env.NODE_ENV === 'production',
				preserveWhitespace: false,
				postcss: [require('autoprefixer')({browsers: ['last 3 versions']})]
			}
		}, {
			loader: 'eslint-loader'
		}]
	} ...

Part of a .vue file:

<style lang="less" src="../less/main.less"></style>

Browser Screenshot

What is the expected behavior?
Client hydration overwrites the SSR-rendered style tags, not duplicates them.

Please mention other relevant information such as your webpack version, Node.js version and Operating System.
OS: Windows 10 x64
Node Version: 9.8.0
webpack version: 3.11.0
vue-loader version: 14.2.1
vue / vue-server-renderer version: 2.5.16

Same issue with:

  • webpack: 4.1.1
  • vue-loader: 14.2.2
  • vue-style-loader: 4.1.0
  • vue/vue-server-render: 2.5.16
commented

Confirm that!
vue-style-loader 4.1.0
Vue 2.5.16
vue-loader 14.2.2
webpack 3.11.0

Edit: Upgraded to vue-loader v15.0.0-beta.1 and this bug has gone.

Can confirm - I don't get this bug anymore with v15.0.5.