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

[Bug Report]: import.meta.glob is not a function #1833

Open
mxyhi opened this issue Oct 18, 2024 · 3 comments
Open

[Bug Report]: import.meta.glob is not a function #1833

mxyhi opened this issue Oct 18, 2024 · 3 comments

Comments

@mxyhi
Copy link

mxyhi commented Oct 18, 2024

Steps to reproduce

  • example : vanilla preact solid
const mods = import.meta.glob(`./**/*`);

console.log(mods);
  • log
module.meta.glob is not a function

Reproduce link

No response

What is actually happening?

const mods = import.meta.glob(`./**/*`);

console.log(mods);

System Info

Uncaught TypeError: module.meta.glob is not a function
@wre232114
Copy link
Member

wre232114 commented Oct 18, 2024

replace

const mods = import.meta.glob(`./**/*`);

with

 import.meta.glob('./**/*');

Using string literal instead of template string

@mxyhi
Copy link
Author

mxyhi commented Oct 21, 2024

取代

const mods = import.meta.glob(`./**/*`);

 import.meta.glob('./**/*');

使用 string literal 而不是 template string

???

@wre232114
Copy link
Member

glob 里面用字符串常量,比如 import.meta.glob('./**/*');。用模版字符串(./**/*)的话会视为一个变量,无法静态分析

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants