Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

121
Views
electron-reload typescript compiled to a wrong object ( to be electronReload['default'])

I am trying to learn typescript with electron a bit, using a template "electron-quick-start-typescript" (https://github.com/electron/electron-quick-start-typescript). I want to add a hot reload function to the template so I could hot reload while editing the code. I am trying to add

import electronReload from "electron-reload";
electronReload(__dirname, {});

these two lines of code, but after the compilation it became

var electron_reload_1 = require("electron-reload");
(0, electron_reload_1["default"])(__dirname, {});

where electron_reload_1["default"] cannot be recognised. I can run the compiled js while I manually changed electron_reload_1["default"] to electron_reload_1.

I guess the problem is because in electron-reload lib, it is not using export default module to export a function. Does anyone has experience on making typescript + electron hot reloadable? Thank you.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I just found that adding "esModuleInterop": true in tsconfig.json would solve this problem.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!