Repository: deno
Issue: node worker_threads --conditions bug (e.g. breaks vitest for solidjs)
Labels: bug,node compat,node resolution

Version: Deno 2.0.3

Repro:
- `deno run -A npm:create-solid`
- Select: SolidStart, TypeScript, **with-vitest** example
- `deno i`
- `deno task test`


### Vitest 1.6.0

Error:

<details open >
<summary>Deno fails - vitest 1.6.0</summary>

```
➜ deno task test
Task test vitest run

 RUN  v1.6.0 

 ❯ src/components/Counter.test.tsx  (1 test | 1 failed) 4ms
   ❯ src/components/Counter.test.tsx > <Counter /> > increments value
     → Client-only API called on the server side. Run client-only code in onMount, or conditionally run client-only component with <Show>.

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

 FAIL  src/components/Counter.test.tsx > <Counter /> > increments value
Error: Client-only API called on the server side. Run client-only code in onMount, or conditionally run client-only component with <Show>.
 ❯ notSup node_modules/.deno/solid-js@1.9.3/node_modules/solid-js/web/dist/server.js:1136:9
 ❯ Module.render node_modules/.deno/@solidjs+testing-library@0.8.10/node_modules/@solidjs/testing-library/dist/index.js:55:65
     53|     }
     54|   }) : wrappedUi;
     55|   const dispose = hydrate ? solidHydrate(routedUi, container) : solidRender(routedUi, container);
       |                                                                 ^
     56|   mountedContainers.add({ container, dispose });
     57|   const queryHelpers = getQueriesForElement(container, queries);
 ❯ src/components/Counter.test.tsx:8:29
 ❯ eventLoopTick ext:core/01_core.js:175:7

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯

 Test Files  1 failed (1)
      Tests  1 failed (1)
   Start at  18:34:34
   Duration  927ms (transform 71ms, setup 67ms, collect 184ms, tests 4ms, environment 302ms, prepare 80ms)
```
</details>

Now trying to run in same folder with `npm run test`, `bun run test` or `node --run test` (Node 22) does work

<details>
<summary>Npm works - vitest 1.6.0</summary>

```sh
➜ npm run test         

> test
> vitest run


 RUN  v1.6.0

 ✓ src/components/Counter.test.tsx (1)
   ✓ <Counter /> (1)
     ✓ increments value

 Test Files  1 passed (1)
      Tests  1 passed (1)
   Start at  18:36:43
   Duration  566ms (transform 72ms, setup 45ms, collect 152ms, tests 39ms, environment 189ms, prepare 43ms)
```

</details>



### Vitest 2.1.3 (or vitest 3.x) - Same thing

Tried updating the Vitest to 2.x `"vitest": "^2.0.0"` (upstream [PR](https://github.com/solidjs/solid-start/pull/1665)), and it's the same result:

<details>
<summary>Deno fails - vitest 2.1.3</summary>

```
➜ deno task test
Task test vitest run

 RUN  v2.1.3

 ❯ src/components/Counter.test.tsx (1)
   ❯ <Counter /> (1)
     × increments value

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

 FAIL  src/components/Counter.test.tsx > <Counter /> > increments value
Error: Client-only API called on the server side. Run client-only code in onMount, or conditionally run client-only component with <Show>.
 ❯ notSup node_modules/.deno/solid-js@1.9.3/node_modules/solid-js/web/dist/server.js:1136:9
 ❯ Module.render node_modules/.deno/@solidjs+testing-library@0.8.10/node_modules/@solidjs/testing-library/dist/index.js:55:65
     53|     }
     54|   }) : wrappedUi;
     55|   const dispose = hydrate ? solidHydrate(routedUi, container) : solidRender(routedUi, container);
       |                                                                 ^
     56|   mountedContainers.add({ container, dispose });
     57|   const queryHelpers = getQueriesForElement(container, queries);
 ❯ src/components/Counter.test.tsx:8:29
 ❯ Object.runMicrotasks ext:core/01_core.js:672:26
 ❯ processTicksAndRejections ext:deno_node/_next_tick.ts:57:10
 ❯ runNextTicks ext:deno_node/_next_tick.ts:74:3

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯

 Test Files  1 failed (1)
      Tests  1 failed (1)
   Start at  19:01:16
   Duration  861ms (transform 80ms, setup 98ms, collect 201ms, tests 3ms, environment 332ms, prepare 48ms)

```
</details>

with npm it works

<details>
<summary>Npm works - vitest 2.1.3</summary>

```
➜ npm run test

> test
> vitest run


 RUN  v2.1.3 

(node:99528) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
stdout | src/components/Counter.test.tsx > <Counter /> > increments value
TESTVAR: undefined

 ✓ src/components/Counter.test.tsx (1)
   ✓ <Counter /> (1)
     ✓ increments value

 Test Files  1 passed (1)
      Tests  1 passed (1)
   Start at  19:01:39
   Duration  709ms (transform 82ms, setup 75ms, collect 139ms, tests 35ms, environment 201ms, prepare 73ms)
```
</details>