Skip to content

Alias "~" resolved incorrectly in <img> src attr #13149

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

Closed
7 tasks done
doooooit opened this issue May 11, 2023 · 2 comments
Closed
7 tasks done

Alias "~" resolved incorrectly in <img> src attr #13149

doooooit opened this issue May 11, 2023 · 2 comments
Labels
duplicate This issue or pull request already exists

Comments

@doooooit
Copy link

doooooit commented May 11, 2023

Describe the bug

I have set alias '~/': `${path.resolve(__dirname, 'src')}/`
It's perfect in import declaration
But I got a file path src/assets/file and it resolved incorrectly in <img src="~/assets/file">( result <img src="assets/file">)
On the other hand, It works fine in webpack

Reproduction

https://stackblitz.com/edit/vitejs-vite-8mvyad

Steps to reproduce

No response

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 16.14.2 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 7.17.0 - /usr/local/bin/npm
  npmPackages:
    @vitejs/plugin-vue: ^4.2.1 => 4.2.1 
    vite: ^4.3.2 => 4.3.5

Used Package Manager

npm

Logs

No response

Validations

@bolt-new-by-stackblitz
Copy link

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@sapphi-red
Copy link
Member

Duplicate of vitejs/vite-plugin-vue#15

@sapphi-red sapphi-red marked this as a duplicate of vitejs/vite-plugin-vue#15 May 11, 2023
@sapphi-red sapphi-red closed this as not planned Won't fix, can't repro, duplicate, stale May 11, 2023
@sapphi-red sapphi-red added duplicate This issue or pull request already exists and removed pending triage labels May 11, 2023
@github-actions github-actions bot locked and limited conversation to collaborators May 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants