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 as: 'raw' fails for template strings #10947

Closed
7 tasks done
janosh opened this issue Nov 16, 2022 · 1 comment
Closed
7 tasks done

import.meta.glob as: 'raw' fails for template strings #10947

janosh opened this issue Nov 16, 2022 · 1 comment
Labels
p2-nice-to-have Not breaking anything but nice to have (priority)

Comments

@janosh
Copy link

janosh commented Nov 16, 2022

Describe the bug

import.meta.glob(`./*`, { as: `raw` })

raises

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

When removing the { as: `raw` } part, the error disappears.

When replacing backticks with single quotes, the error also disappears: import.meta.glob('./*', { as: 'raw' }).

Related: #9349

Reproduction

https://stackblitz.com/edit/vitejs-vite-2rd1zk?file=counter.js&terminal=dev

Steps to reproduce

No response

System Info

StackBlitz

Used Package Manager

npm

Logs

No response

Validations

@bluwy bluwy added bug p2-nice-to-have Not breaking anything but nice to have (priority) and removed pending triage labels Nov 16, 2022
sun0day pushed a commit to sun0day/vite that referenced this issue Nov 17, 2022
@sapphi-red
Copy link
Member

This now works. I guess #10999 fixed this.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants