Skip to content
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

Explicit URL imports import the module when used with javascript files #16648

Closed
7 tasks done
kallekankaanpaa opened this issue May 10, 2024 · 1 comment · Fixed by #17915
Closed
7 tasks done

Explicit URL imports import the module when used with javascript files #16648

kallekankaanpaa opened this issue May 10, 2024 · 1 comment · Fixed by #17915
Labels
inconsistency Inconsistency between dev & build p2-edge-case Bug, but has workaround or limited in scope (priority)

Comments

@kallekankaanpaa
Copy link

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

  1. npm install
  2. npm 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/npm

Used Package Manager

npm

Logs

No response

Validations

Copy link

stackblitz bot commented May 10, 2024

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

sapphi-red added a commit to sapphi-red/vite that referenced this issue Aug 21, 2024
@sapphi-red sapphi-red added p2-edge-case Bug, but has workaround or limited in scope (priority) inconsistency Inconsistency between dev & build labels Aug 21, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Sep 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
inconsistency Inconsistency between dev & build p2-edge-case Bug, but has workaround or limited in scope (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants