-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Open
Labels
✨ feature requestNew feature or requestNew feature or request
Description
Vue version
3.5.16
Link to minimal reproduction
https://github.com/OrbisK/vue-img-src-tilde
Steps to reproduce
pnpm i
pnpm dev
- Error. The first '~' is always stripped.
What is expected?
The first ~
should not be stripped.
What is actually happening?
core/packages/compiler-sfc/src/template/templateUtils.ts
Lines 22 to 29 in cdffaf6
export function parseUrl(url: string): UrlWithStringQuery { | |
const firstChar = url.charAt(0) | |
if (firstChar === '~') { | |
const secondChar = url.charAt(1) | |
url = url.slice(secondChar === '/' ? 2 : 1) | |
} | |
return parseUriParts(url) | |
} |
This does always remove the first ~
System Info
System:
OS: Linux 6.8 Ubuntu 24.04.1 LTS 24.04.1 LTS (Noble Numbat)
CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
Memory: 36.29 GB / 62.58 GB
Container: Yes
Shell: 5.9 - /usr/bin/zsh
Binaries:
Node: 23.5.0 - ~/.nvm/current/bin/node
npm: 10.9.2 - ~/.nvm/current/bin/npm
pnpm: 8.15.9 - ~/.nvm/current/bin/pnpm
bun: 1.1.42 - ~/.nvm/current/bin/bun
Browsers:
Chrome: 130.0.6723.69
npmPackages:
vue: ^3.5.13 => 3.5.16
Any additional comments?
Nuxt uses ~
as alias for the /app
directory.
Ref: vitejs/vite-plugin-vue#15
Ref: nuxt/nuxt#32119 (comment)
/cc @danielroe
9romise
Metadata
Metadata
Assignees
Labels
✨ feature requestNew feature or requestNew feature or request