Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(compiler-sfc) transformAssetUrl breaks when base includes host #12731

Closed
jonaskuske opened this issue Aug 9, 2022 · 0 comments · Fixed by #12732
Closed

(compiler-sfc) transformAssetUrl breaks when base includes host #12731

jonaskuske opened this issue Aug 9, 2022 · 0 comments · Fixed by #12732

Comments

@jonaskuske
Copy link
Contributor

jonaskuske commented Aug 9, 2022

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant