🌐 AI搜索 & 代理 主页
Skip to content

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

@jonaskuske

Description

@jonaskuske

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions