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

204
Vistas
Electron Error - Require is not a function

I am using electron to create an application.

The main page has two buttons - Button 1 and Button 2.

On Click of the button, I am redirecting to another Html Page.

<div class = "container">
     <a class="btn btn-success" href="./src/page1.html" role="button">Go to Page 1</a>
</div>
<div class = "container">
     <a class="btn btn-success" href="./src/page2.html" role="button">Go to Page 2</a>
</div>

Then in the Page1.html, I am adding the corresponding JS in script tag.

<script src="page1.js"></script>

However, in the JS file, I am not able to use the require function. Error: Require is not a function.

However, require function works fine in main.js

Please help me in figuring out what am I doing wrong. I have just recently started with Electron.

Any help appreciated.

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