(compiler-sfc) transformAssetUrl breaks when base includes host

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

Version

2.7.8

Reproduction link

github.com/jonaskuske/vue2-asset-base-repro

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

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date