-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Closed
Labels
inconsistencyInconsistency between dev & buildInconsistency between dev & buildp2-edge-caseBug, but has workaround or limited in scope (priority)Bug, but has workaround or limited in scope (priority)
Description
Describe the bug
When trying to import the URL of a javascript file with the explicit URL import as described in the documentation the javascript module is imported rather than just the URL of the module.
This only happens when running the code with npm run dev the bundle built with npm run build works as expected.
Reproduction
https://stackblitz.com/edit/vitejs-vite-ubhupq?file=main.js
Steps to reproduce
npm installnpm run dev
System Info
System:
OS: Linux 5.15 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
Memory: 2.81 GB / 7.62 GB
Container: Yes
Shell: 5.1.16 - /bin/bash
Binaries:
Node: 20.12.2 - ~/.nvm/versions/node/v20.12.2/bin/node
npm: 10.5.2 - ~/.nvm/versions/node/v20.12.2/bin/npmUsed Package Manager
npm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Metadata
Metadata
Assignees
Labels
inconsistencyInconsistency between dev & buildInconsistency between dev & buildp2-edge-caseBug, but has workaround or limited in scope (priority)Bug, but has workaround or limited in scope (priority)