svitejs / node-conditions

MIT License
9 stars 0 forks source link

`development` condition is flaky #17

Open benmccann opened 2 days ago

benmccann commented 2 days ago

Describe the bug

https://github.com/sveltejs/svelte/issues/14022

Reproduction URL

?

Reproduction

the linked issue uses esm-env. would need to somehow change it to use node-conditions. maybe rename node-conditions to esm-env locally and then use it via overrides

Logs

No response

System Info

node 20.17.0

Severity

blocking all usage of node-conditions

dominikg commented 2 days ago

so this is a doozy. the bug only seems to appear if you use a dependency that also depends on esm-env.

pnpx sv create, dev works fine pnpm i -D bits-ui and adding a component of them, dev works fine pnpm i -D bits-ui@^1.0.0-next.0 and dev breaks

my current working theory is that it is connected with the optimizer and the extra indirection of the subpath "reexport".

the tests in this repo using node -C development show it works fine though, really strange