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.

Creating app using webpack, electron and bytenode

See original GitHub issue

Hi, I am trying to create a app using webpack and electron. My end goal is to hide the sources for my application. I created the bytecode for bundle.js and I am trying to use the bundle.jsc in my index.html So I did the following

require("bytenode");
module.exports = require("./build/bundle.jsc");

Named the above file as dist.js and used in index.html as follows

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

When I launch the electron app with electron .

I get the following error

Uncaught Error: Invalid or incompatible cached data (cachedDataRejected)
    at Object.Module._extensions.<computed> [as .jsc]

bundle.jsc is 2.1MB Node version is v12.13.0

Thanks,

Issue Analytics

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

github_iconTop GitHub Comments

5reactions
smunxcommented, Jan 7, 2020

I got it to work, I used electron to compile it to bytecode. Thanks for the awesome tool !

1reaction
OsamaAbbascommented, Jan 2, 2020

Replace this line:

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

with this code:

<script>
  require("bytenode");
  // put here whatever code is inside your dist.js. For example:
  // require("./build/bundle.jsc").initApp();
</script>

Try this and let me know what would happen.

Also, make sure that you have compiled your .jsc files with the same electron that will run them.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Creating app using webpack, electron and bytenode · Issue #44
Hi, I am trying to create a app using webpack and electron. My end goal is to hide the sources for my application....
Read more >
Developers - Creating app using webpack, electron and bytenode -
Hi, I am trying to create a app using webpack and electron. My end goal is to hide the sources for my application....
Read more >
Creating Javascript Binaries For Electron | by Jeff Robbins
Bytenode is a library created by Osama Abbas which facilitates saving and ... It uses Electron Forge along with Webpack to bundle applications...
Read more >
electron-bytenode-webpack-plugin - npm
Compiles electron JS files to V8 bytecode. ... Start using electron-bytenode-webpack-plugin in your project by running `npm i ...
Read more >
Building a desktop app with electron, webpack and redux
To highlight some of the things that a desktop application excels in from a normal web app, we'll need to build something using...
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