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

295
Visualizações
__webpack_require__(...).context is not a function

I'm getting

index.js:978 TypeError: __webpack_require__(...).context is not a function
at eval (index.vue:20)
at Object.dqAR (pages-investment-pages-home-index.js:348)
at __webpack_require__ (index.js:854)
at fn (index.js:151)
at eval (null:1)
at Module.Hi1e (pages-investment-pages-home-index.js:177)
at __webpack_require__ (index.js:854)
at fn (index.js:151)
at eval (null:1)
at Module.bE2I (pages-investment-pages-home-index.js:320)

here is my code

const path = './'
require.context(path,false,/\.js$/)

it looks like the arguments of require.context can't be a varible. because when i used like this it works fine:

require.context('./',false,/\.js$/)

i am confuse about it.

is that because of this function is belong to webpack and it's running before the compile?

thanks for ur answer.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The arguments passed to require.context must be literals! (look at warning in the link)

In the images below the right side is the generated webpack from left side:

Using literals generates valid __webpack_require__: using litterals in require.context

Using variables generated invalid __webpack_require__: using variable in require.context

about 4 years ago · Juan Pablo Isaza Relatório
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