question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

A JavaScript error occurred in the main process

See original GitHub issue
Uncaught Exception:
SyntaxError: Invalid or unexpected token
  at Timeout._onTimeout
  at listOnTimeout (internal/timers.js:531:17)
  at processTimers (internal/timers.js:475:7)

I’m using Electron, and have a file that requires a .jsc file which requires a .jsc file. I did use the same Electron to compile these files to bytecode. And the app was working fine for a minute, until this error randomly popped up. And everytime I clicked ok it popped up again. I had to use Task Manager to kill the process. This was an executable created with electron-builder.

I probably won’t be able to get a minimum example but maybe this will be useful for future reference.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
OsamaAbbascommented, Feb 10, 2020

You have to use the exact same executable to compile and to run .jsc. This is how v8 caching system work. Any other behavior won’t work, even if you use the exact same [numeric] version of Node and v8 itself.

2reactions
qntmcommented, Feb 9, 2020

You probably need to alter your app to say:

require('bytenode')
require('./dispatcher.jsc')

The first line is necessary so that the Node.js module loader can load JSC files - normally it can’t.

Read more comments on GitHub >

github_iconTop Results From Across the Web

A Javascript Error Occurred in the Main Process [Discord]
Corrupt program files – If your program or its settings have gone corrupt, this error and others may be triggered. Deactivated services –...
Read more >
How to Fix the 'A JavaScript Error Occurred in the Main ...
Solution 2: Change the Startup Type of the Quality Windows Audio Video Experience Service ... Changing the startup type of the Quality Windows ......
Read more >
A JavaScript error occurred in the main process message on ...
A JavaScript error occurred in the main process · 1) Delete the app data folders in %AppData% and %LocalAppData%. · 2) Re-register the...
Read more >
A JavaScript Error Occurred in the Main Process Windows 10 ...
Solution: A JavaScript Error Occurred in the Main Process Windows 10 / 11 Fixed.
Read more >
Fix 'A JavaScript Error Occurred in the Main Process' Error in ...
Solutions to fix the “A Javascript Error Occurred in the Main Process” Error in Discord: 1. Delete Discord Folders in AppData and LocalAppData...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found