(compiler-sfc) transformAssetUrl breaks when base includes host

This issue has been tracked since 2022-08-09.



Reproduction link


Steps to reproduce

  • Run npm i to install dependencies
  • Run npm run dev to start the Vite dev server
  • Visit localhost:5179
  • Observe that the request for javascript.svg fails because the URL is broken

What is expected?

The image src is transformed to a valid URL (http://locahost:5173/...)

What is actually happening?

Since all parts are passed to path.join, the URL breaks as one slash is stripped from the protocol (http:/localhost:5173/...)

This is fixed in the v3 version of compiler-sfc, submitted a PR that applies the same behavior to v2 :)

More Details About Repo
Owner Name vuejs
Repo Name vue
Full Name vuejs/vue
Language TypeScript
Created Date 2013-07-29
Updated Date 2022-10-06
Star Count 199800
Watcher Count 6093
Fork Count 32882
Issue Count 590


Issue Title Created Date Updated Date