Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

326
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda