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

106
Visualizações
Next.js production fails but dev works

I had tried to run Next.js project with next start(next build was ok and it works with next dev) and saw some error messages in browser console:

TypeError: e is undefined
Error: Minified React error #130; visit https://reactjs.org/docs/error-decoder.html?invariant=130&args[]=undefined&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
Error: Minified React error #130; visit https://reactjs.org/docs/error-decoder.html?invariant=130&args[]=undefined&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
Error rendering page:  TypeError: t is undefined

I've watched that link in error message and it says:

Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: [missing argument].[missing argument]

But I still don't understand where is the problem. Is there a way to disable code minification in next build and view a full traceback?

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

0

  • The reason why it's doing that in prod and not dev is because nextjs will only check types on a production build (as far as I'm aware).
  • I think I've seen that error before when you pass a string or an invalid value to renderToString from react-dom/server.

The reason that's most likely happening is because nextjs will by default import all your exports and render the page for you, so in this case I don't believe you can just export named or default exports at will, I think it has to be a default export for the page component itself, while all the getStaticProps and other exports should be named.

To fix your issue just change export Example to export default Example.

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