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.

Example for runBytecodeFile not working

See original GitHub issue

Hi,

I compiled a file test.js with console.log('Hello World!') inside. Nothing else. Compilation is done by bytenode -c test.js

Then I use this file (testexe.js) to execute test.jsc const bytenode = require("bytenode"); bytenode.runBytecodeFile('test.jsc');

I use node testexe.js for execution.

I get no ‘Hello World!’ But if I use bytenode test.jsc it works.

I use node v10.13.0 in WIn10 x64

Any ideas?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
edntcommented, May 28, 2019

Thank you for your fast response.

You are right, with this flag my simple example works.

But … If I use --no-module for my real js files, I get a

ReferenceError: require is not defined

when I execute them.

To test this I extended test.js: const os = require('os'); console.log('Hello World!'); console.log(os.hostname());

As soon as I have a require inside the error apears.

0reactions
OsamaAbbascommented, Jun 3, 2019

If you want to use require function, don’t use the --no-module flag. Just compile it as usual. It should work then.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Example for runBytecodeFile not working · Issue #24
Hi, I compiled a file test.js with console.log('Hello World!') inside. Nothing else. Compilation is done by bytenode -c test.js Then I use ...
Read more >
How do I protect a commercial app built with Electron?
I believe this topic has nothing to do with the app being built with electron as almost all apps can be reverse-engineered.
Read more >
A brand new website interface for an even better experience!
Example for runBytecodeFile not working.
Read more >
Top 10 Most Common Node.js Developer Mistakes
In this particular example of a Node.js problem, we are fetching the image from Gravatar, reading it into a Buffer, and then responding...
Read more >
Troubleshooting
These are some common issues you may run into while setting up React Native. If you encounter something that is not listed here,...
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