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

Import Analysis - warns on imports that use a template literal but have no variables #14101

Closed
7 tasks done
coreylight opened this issue Aug 14, 2023 · 1 comment · Fixed by #14458
Closed
7 tasks done
Labels
p2-edge-case Bug, but has workaround or limited in scope (priority)

Comments

@coreylight
Copy link

coreylight commented Aug 14, 2023

Describe the bug

When dynamically importing with something like:

import(`./test.js`)

The import analysis warns even when it probably should not, as the import follows the Rollup rules.

Reproduction

https://stackblitz.com/edit/vitejs-vite-3l8b8y?file=main.js

Steps to reproduce

When booting the app on stackblitz, you'll notice the "The above dynamic import cannot be analyzed by Vite." message

System Info

System:
    OS: macOS 13.4
    CPU: (12) arm64 Apple M2 Max
    Memory: 3.40 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.16.1 - /opt/homebrew/opt/node@18/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 9.5.1 - /opt/homebrew/opt/node@18/bin/npm
  npmPackages:
    @vitejs/plugin-react-swc: ^3.3.2 => 3.3.2 
    vite: 4 => 4.4.9

Used Package Manager

yarn

Logs

No response

Validations

@stackblitz
Copy link

stackblitz bot commented Aug 14, 2023

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p2-edge-case Bug, but has workaround or limited in scope (priority)
Projects
None yet
2 participants