(compiler-sfc) transformAssetUrl breaks when base includes host

This issue has been created 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-09-27
Star Count 199644
Watcher Count 6098
Fork Count 32848
Issue Count 587

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
Cherry-picking use-after-free in btree code fix from OpenZFS repository suggested 0 2022-09-17 2022-09-26
flashes white when loading widgets 9 2022-03-26 2022-09-18
Stuck after killing X 10 2021-01-28 2022-07-29
Fix references on rename and move 5 2022-01-12 2022-08-21
Want to achieve three dot is first, checkbox in 2nd position, and the other columns after in Datagrid 4 2022-06-14 2022-09-26
[BUG] "TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases" when building envpool from sources 2 2022-07-15 2022-08-25
[BUG] `Atlantis-v5` does not reset life counter. 9 2022-07-18 2022-08-25
Counter-Strike: Condition Zero Deleted Scenes 5 2021-09-19 2022-01-18
[question] Group repetition output feature? 2 2021-01-05 2022-07-28
The app if used as an assistant app is closed in the background 4 2021-03-28 2022-08-15
环境和batchsize 1 2021-02-09 2021-12-18
Recommendation for running cron in replicated services 1 2021-09-29 2022-09-26
can't write CSV directly onto sftp.file.open 1 2021-03-30 2022-09-18
Upgrading to ruby 3.1 leads to "verify_signature" error 7 2022-01-17 2022-09-18
验证git地址合法性有问题 0 2018-06-15 2022-01-24
error: release version 17 not supported 2 2021-12-29 2022-09-19
insights: Allow search contexts as filters to code insights (v0) 9 2022-03-30 2022-09-10
How to reduce padding between calendar tray and system tray? 1 2021-04-27 2022-09-04
MAP_ANONYMOUS undefined on macOS 5 2021-03-03 2022-09-16
Failed to build Dockerfile stable-3_3_1 2 2021-10-05 2022-07-21
[BUG] [Ruby Client]When only translation_bundle is exist, the placeholder can't replace and throw error 1 2022-05-27 2022-09-19
Add-PnpListItem with Batch cannot add values 2 2021-06-22 2022-09-09
abp-cli add option switch-dbms to change database provider 1 2022-06-14 2022-09-25
Replace Definition URI in AWS::Serverless::StateMachine with repo bucket 0 2021-04-21 2022-09-13
citi.bridgetrack.com 1 2022-01-17 2022-08-05
Check MSI can be installed with expired license key 0 2022-01-02 2021-12-30
Admin UI caches info from the old license key 1 2022-01-01 2021-12-30
The server continues to run after trial license is expired 0 2022-01-01 2021-12-30
Text between "<%" and "%>" not minified in script tag 3 2022-03-26 2022-09-18
maxLineLength will split after <pre><code> element 0 2022-03-17 2022-08-04
MDBModalDialog container should be placed in same container as modal's backdrop 2 2021-07-26 2022-09-13
Support + in key names 9 2019-07-12 2022-08-29
[Feature Request] Arm64 ubuntu support 8 2022-08-01 2022-09-08
Narrowing unions with Literal and TypedDict 2 2019-11-13 2022-09-13
How I can apply the Strict Search and the Fuzzy Search in Lucene.NET 1 2022-05-18 2022-09-18
“Generate Memberwise Initializer” adds unnecessary “internal” keyword 4 2022-04-29 2022-07-23
Allow simulations including leap days 1 2022-02-03 2022-08-22
Handle ScanCode TK new `--consolidate` option 1 2019-09-06 2022-08-30
alpine images not work 2 2017-02-14 2022-08-29
SVG with namespace parameters 0 2022-07-22 2022-09-19
如何裁剪此插件,我只需要debuger调试器子功能,要怎么定制呢? 2 2021-03-08 2022-09-24
Horizontal scroll is not smooth 6 2020-11-28 2022-09-18
Search takes too long for big index files 4 2020-10-30 2022-09-17
[Bug]: beam_PostCommit_Go_VR_spark is failing 2 2022-08-29 2022-09-04
Customise Limits of "Colour By Slope" 11 2021-10-07 2022-09-08
Seamarks Not Displaying Correctly in Boat Profile 0 2021-10-10 2021-12-07
[Bug]: Unable to serialize objects with Localizedfields 2 2021-11-24 2022-08-29
Question about version compatibility of go-client with k8s api server 7 2021-08-30 2022-09-24
4.3 node.heartbeat can not be overridden from environment variable 2 2021-10-14 2022-07-23
Running Protractor tests without internet access fails 1 2021-01-19 2022-09-25