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.

Invalid or incompatible cached data (cachedDataRejected)

See original GitHub issue

Hello Osama,

I have the following problem below:

Error: Invalid or incompatible cached data (cachedDataRejected)
    at Object.Module._extensions.<computed> [as .jsc] (/home/<user>/nodevenv/node_modules/bytenode/lib/index.js:270:11)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:93:18)
    at Object.<anonymous> (/home/<user>/nodevenv/<process-path>/main.loader.js:3:5)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)

I have seen https://github.com/bytenode/bytenode/issues/63 but I’m not sure if it’s the same use-case as I do have here.

Here is what happened:

  • I did initial CD deployment, it worked fine
  • improved some of the code (worked on other things)
  • did another push, CD deployment, it worked fine
  • improved some of the code (worked on other things)
  • Repeated the same process above for about 5-10 times
  • At once (I didn’t check the deployed environment after few commits so… I definitely need to guess which commit is the problem), I am getting that error, I am trying to figure it out if it’s a deployment issue or something in my code.

In deployment, I stop the environment >> delete the old files >> reupload the new files >> start off the environment

I am running NestJS and unfortunately, I cannot upload a minimal reproduction for this issue nor that I can upload my project.

But may I please ask Osama, what could be the possible issues that can have this to happen?

You mentioned:

I did as promised. However, there are many moving parts here (electron, vue, the whole build system, your own implementation of bytenode protection… etc). It will take some time to pin where the issue lie exactly.

cachedDataRejected is always because the runtime executable differs from the executable that was used to generate the .jsc file. Also, any JavaScript code that will be run as a «browser javascript» (which is the case with Vue) cannot be compiled by bytenode. Bytenode only deals with «Node.js javascript». Your problem might be here (still not sure because I have not finished reading your code).

If you want to protect your «browser javascript» code, try using NW.js instead of Electron. They have a tool called nwjc that does just that.

Can you please explain more about this “cachedDataRejected is always because the runtime executable differs from the executable that was used to generate the .jsc file.”?

Much appreciated.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
SDAdhamcommented, Nov 9, 2021

Yes, I made sure that both are the same and it’s working, many thanks. I kinda figured from your statement:

cachedDataRejected is always because the runtime executable differs from the executable that was used to generate the .jsc file.

Many thanks Osama, you are awesome! 😃

0reactions
janafsalcommented, Sep 29, 2022

It might be easier to install a 32-bit virtual machine from here https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/ (choose one of the windows 7 machines, they are 32-bit) and build your app there.

This will be a cool idea, thanks bro… will try this one…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Invalid or incompatible cached data (cachedDataRejected ...
I'm trying to protect the electron code using bytenode but I'm running onto the Invalid or incompatible cached data error when running the...
Read more >
Invalid or incompatible cached data (cachedDataRejected ...
I'm trying to protect the electron code using bytenode but I'm running onto the Invalid or incompatible cached data error when running the...
Read more >
How to retrieve the bytecode of NodeJS VM state? JavaScript ...
Script(dummyCode, { cachedData: bytecodeBuffer }); if (script.cachedDataRejected) { throw new Error('Invalid or incompatible cached data ...
Read more >
What Is Cached Data? Learn How to Delete ... - Reviews.org
Open your Settings. · Tap the Storage option. · Tap Other Apps to see a list of all of your installed apps. ·...
Read more >
I'm getting an error at the end of installation, and the same ...
[Content] Uncaught Exception: Error: Invalid or incompatible cached data (cachedDataRejected) at Object.Module._extensions.
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