Skip to content

vitest and isolted-vm incompatible? #481

Open
@ludusrusso

Description

@ludusrusso

I'm having some problems running isolated-vm inside a vitest test after upgrading to node 20.

With node 18.x it works well, after switching to node v20 I have a segmentation fault [1] 2778 segmentation fault pnpm run test

Quite sure this is releated with --no-node-snapshot but it seems it is incompatible with vitest.
I've read the docs of vitest and it seems is not possible to de-opt from vitest js vm.

This is what happens when I run vitest with NODE_OPTIONS=--no-node-snapshot

Error: Initiated Worker with invalid NODE_OPTIONS env variable: --no-node-snapshot is not allowed in NODE_OPTIONS
 ❯ new Worker node:internal/worker:225:13
 ❯ ThreadWorker.initialize ../../node_modules/.pnpm/[email protected]/node_modules/tinypool/dist/esm/index.js:139:19
 ❯ ThreadPool._addNewWorker ../../node_modules/.pnpm/[email protected]/node_modules/tinypool/dist/esm/index.js:678:12
 ❯ ThreadPool._ensureMinimumWorkers ../../node_modules/.pnpm/[email protected]/node_modules/tinypool/dist/esm/index.js:663:12
 ❯ new ThreadPool ../../node_modules/.pnpm/[email protected]/node_modules/tinypool/dist/esm/index.js:648:10
 ❯ new Tinypool ../../node_modules/.pnpm/[email protected]/node_modules/tinypool/dist/esm/index.js:950:31
 ❯ createThreadsPool ../../node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vitest/dist/vendor/cac.qnW6GNL2.js:8776:16
 ❯ threads ../../node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vitest/dist/vendor/cac.qnW6GNL2.js:9425:22
 ❯ ../../node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vitest/dist/vendor/cac.qnW6GNL2.js:9450:39

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { code: 'ERR_WORKER_INVALID_EXEC_ARGV' }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions