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.meta.glob complains about template strings even if they're static #9349

Closed
7 tasks done
janosh opened this issue Jul 25, 2022 · 0 comments · Fixed by #9352
Closed
7 tasks done

import.meta.glob complains about template strings even if they're static #9349

janosh opened this issue Jul 25, 2022 · 0 comments · Fixed by #9352
Labels
p2-edge-case Bug, but has workaround or limited in scope (priority)

Comments

@janosh
Copy link

janosh commented Jul 25, 2022

Describe the bug

Back tick strings in import.meta.glob()

import.meta.glob(`./*.js`);

raise

[plugin:vite:import-glob] Invalid glob import syntax: Could only use literals

even when not used as templates.

Reproduction

https://stackblitz.com/edit/vitejs-vite-vxmqui?file=counter.js

System Info

System:
    OS: macOS 12.4
    CPU: (10) arm64 Apple M1 Pro
    Memory: 92.72 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.6.0 - /opt/homebrew/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 8.13.2 - /opt/homebrew/bin/npm
  Browsers:
    Brave Browser: 103.1.41.100
    Safari: 15.5
  npmPackages:
    vite: ^3.0.2 => 3.0.2

Used Package Manager

yarn

Logs

No response

Validations

@sapphi-red sapphi-red added the p2-edge-case Bug, but has workaround or limited in scope (priority) label Jul 25, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Aug 9, 2022
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
Development

Successfully merging a pull request may close this issue.

2 participants