uvue icon indicating copy to clipboard operation
uvue copied to clipboard

css:sourceMap:true + stylus-loader = multiple Vue instantiations

Open phil294 opened this issue 4 years ago • 1 comments

Describe the bug The vue instantiation in main.js happens multiple times, once for every stylus stylesheet, if css source maps are activated. I dont know what possible further problems this may cause, but something is probably not right here.

To Reproduce

  1. In vue.config.js,
    css: {
        sourceMap: true,
    },
    
  2. Delete postcss.config.js (because it seems to overwrite the sourcemap setting or something like that)
  3. Install stylus and stylus-loader (v3.x for compatibility issues)
  4. Add some non-empty stylus style tags into some view or component
  5. On every page refresh, the vue instance will be created 1 + [number of files with some stylus stylesheets in it] times

Or just see the commit from the repro repo where I demonstrated this:

Reproduction repo/demo link run and check server console for the console.log from main.js

Expected behavior Only one vue instance creation per page refresh

Additional context

Please indicate versions of:

node: 12.20
vue-cli: 
uvue: 0.1.7
os: manjaro linux
browser: chromium latest

phil294 avatar Jan 03 '21 13:01 phil294

Thanks again for this nice report!

You're right, when you have your browser devtools opened, this one will try to get source maps files and trigger a server-side rendering request...

I'll try to fix this, but this issue will only impact developers and not your actual users :)

yabab-dev avatar Jan 03 '21 22:01 yabab-dev