Describe the bug
The following does not work because of the query parameter:
const demo = (x) => new URL(`/sample/${x}/example.jpg?abc`, import.meta.url).href
If you remove ?abc then it works again.
Here are the docs for this feature: https://vitejs.dev/guide/assets.html#new-url-url-import-meta-url
And the code for the feature: https://github.com/vitejs/vite/blob/main/packages/vite/src/node/plugins/assetImportMetaUrl.ts
Query parameters are needed to support vite-imagetools
#11157 is potentially related, but it's unclear if it's the same issue
Reproduction
https://github.com/benmccann/import.meta.url-with-query-params
Steps to reproduce
Run npm install followed by npm run dev
System Info
npmPackages:
vite: ^4.3.2 => 4.3.3
Used Package Manager
npm
Logs
No response
Validations
Describe the bug
The following does not work because of the query parameter:
If you remove
?abcthen it works again.Here are the docs for this feature: https://vitejs.dev/guide/assets.html#new-url-url-import-meta-url
And the code for the feature: https://github.com/vitejs/vite/blob/main/packages/vite/src/node/plugins/assetImportMetaUrl.ts
Query parameters are needed to support
vite-imagetools#11157 is potentially related, but it's unclear if it's the same issue
Reproduction
https://github.com/benmccann/import.meta.url-with-query-params
Steps to reproduce
Run
npm installfollowed bynpm run devSystem Info
npmPackages: vite: ^4.3.2 => 4.3.3Used Package Manager
npm
Logs
No response
Validations