Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

323
Views
Why does calling a undefined method in import.meta throw the error (intermediate value).(...) is not a function?

I am trying to call import.meta.glob() in an Astro/Vite project inside a utility function. A Vite plugin too calls it. And when a Vite plugin runs, Vite hasn't yet started resolving imports. As a result, the import.meta.glob function is getting called by Node.js and not Vite. And it's not present in the Node runtime.

But why is Node.js throwing the error (intermediate value).glob is not a function instead of import.meta.glob is not a function?

But if I run the following code, then I get the error importMeta.glob is not a function correctly.

const importMeta = import.meta;

importMeta.glob();

So, why is it happening for import.meta only? Typically it happens when we forget to place a semicolon between a function declaration and an immediately invoked function expression. But this is definitely not the case here.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!