You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Actual Result
import { createMachine, interpret } from 'xstate';
^^^^^^^^^
SyntaxError: The requested module 'xstate' does not provide an export named 'interpret'
at ModuleJob._instantiate (internal/modules/esm/module_job.js:92:21)
at async ModuleJob.run (internal/modules/esm/module_job.js:107:20)
at async Loader.import (internal/modules/esm/loader.js:179:24)
steve@Steves-MBP src % node -v
v14.0.0
The text was updated successfully, but these errors were encountered:
Yes. We currently don't provide enough information for node (through package.json) for it to be able to load our ESM files. The issue is not so simple as it might look like though, comes with some caveats and at this point in time changing it for v4 would be a breaking change for every ESM consumer in node as they would have to change all import statements for XState. The support for modules in node is also still considered as experimental so I don't really think that we should jump into fixing this straight away (especially that - as mentioned - this only looks trivial, we also don't know yet how bundlers will handle conditional exports which are expected to be handled by them)
Description
Super quick example fails to run
Expected Result
Actual Result
import { createMachine, interpret } from 'xstate';
^^^^^^^^^
SyntaxError: The requested module 'xstate' does not provide an export named 'interpret'
at ModuleJob._instantiate (internal/modules/esm/module_job.js:92:21)
at async ModuleJob.run (internal/modules/esm/module_job.js:107:20)
at async Loader.import (internal/modules/esm/loader.js:179:24)
steve@Steves-MBP src % node -v
v14.0.0
The text was updated successfully, but these errors were encountered: