Invalid or incompatible cached data (cachedDataRejected)
See original GitHub issueHello 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:
- Created 2 years ago
- Comments:10
Top GitHub Comments
Yes, I made sure that both are the same and it’s working, many thanks. I kinda figured from your statement:
Many thanks Osama, you are awesome! 😃
This will be a cool idea, thanks bro… will try this one…