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

206
Visualizações
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 à 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