Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

267
Vistas
NextJS - `dev` not working but `build` && `start` do

Created a Next (version: 12.0.7) with Typescript and Storybook. I can build and start the server, however, dev fails once I make a request and spits out this message:

Browser:

Uncaught ReferenceError: __webpack_require__ is not defined

Backend: No error message

I'm using Chakra UI, next-i18next and next-auth.

Reproduce error

  1. Create a next app using typescript npx create-next-app@latest --ts
  2. You will now face the error exports is not defined. Using this hack you can create a custom _document.tsx with this content:
import Document, {
    Html,
    Head,
    Main,
    NextScript,
    DocumentContext,
} from "next/document"

class MyDocument extends Document {
    static async getInitialProps(ctx: DocumentContext) {
        const initialProps = await Document.getInitialProps(ctx)
        return {...initialProps}
    }

    render() {
        return (
            <Html>
                <Head />
                <body>
                <Main />
                <script>var exports = {"{}"};</script>
                <NextScript />
                </body>
            </Html>
        )
    }
}

export default MyDocument
  1. Run yarn run dev
  2. Visit http://localhost:3000/
  3. See console
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

I was having a similar issue where next dev would log:

ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info  - Loaded env from /.../.env
event - compiled client and server successfully in 6.4s (2106 modules)

But when trying to access the site from Chrome or any other browser, nothing would happen, it would just get stuck loading forever.

It turns out the issue was cause by the VPN I was using (CyberGhost). After disabling it, everything worked again.

about 4 years ago · Juan Pablo Isaza Denunciar

0

FOUND THE TROUBLEMAKER!

When I opened the site in Chrome (which I personally don't use and so it doesn't have any extensions installed), the site worked flawlessly. After some digging, I found out that my Anti-Ad-Blocker was the troublemaker. Disabling it finally solved this error!

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda