The node specification (https://nodejs.org/api/packages.html#conditional-exports), says:
import - matches when the package is loaded via import or import(), or via any top-level import or resolve operation by the ECMAScript module loader. Applies regardless of the module format of the target file. Always mutually exclusive with "require".
So I think this should be the esm bundle (xstate.esm.js).
XState version
XState version 5
Description
I tried using xstate in the svelte repl (https://svelte.dev/playground/ffbd26371a294d11a437a74fbc064ad7?version=5.2.2), but it fails loading the xstate package. I think this is because the
exports
map specifiesimport
to use the.mjs
file, which reexports the commonjs modules.The node specification (https://nodejs.org/api/packages.html#conditional-exports), says:
import
- matches when the package is loaded via import or import(), or via any top-level import or resolve operation by the ECMAScript module loader. Applies regardless of the module format of the target file. Always mutually exclusive with "require".So I think this should be the esm bundle (
xstate.esm.js
).Expected result
The repl to start.
Actual result
Did not start
Reproduction
https://svelte.dev/playground/ffbd26371a294d11a437a74fbc064ad7?version=5.2.2
Additional context
No response