laverdet / isolated-vm

Secure & isolated JS environments for nodejs
ISC License
2.19k stars 154 forks source link

How to add --no-node-snapshot option when running the command npx jest? #466

Closed Kuroakira closed 7 months ago

Kuroakira commented 7 months ago

I've using isolated-vm to run async batch function with nodejs v18 and nestjs. Today I've updated node version to v20.12.2. I've comfirmed that nestjs server run with the following command.

success command

NODE_OPTIONS='--no-node-snapshot' nest start

However, when I run the following command, I got an error.

fail command

NODE_OPTIONS='--no-node-snapshot' npx jest --runInBand

error message

node: symbol lookup error: /home/XX/workspace/XX/XX/node_modules/isolated-vm/out/isolated_vm.node: undefined symbol: _ZN2v814ScriptCompiler24CompileFunctionInContextENS_5LocalINS_7ContextEEEPNS0_6SourceEmPNS1_INS_6StringEEEmPNS1_INS_6ObjectEEENS0_14CompileOptionsENS0_13NoCacheReasonEPNS1_INS_14ScriptOrModuleEEE

Is my setting of the command wrong? I'm not much familiar with both nodejs and jest. So maybe I'm wrong and I didn't find any way to solve the problem. I'll be glad that someone helps me.

Kuroakira commented 7 months ago

Sorry I solved the problem with the latest version.