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
In StateNode.ts, there is a reference to process. Since a web browser does not have this variable, you can not load xstate using ES modules in a browser.
(Bug) Expected result:
I can load xstate using ES modules in a browser
(Bug) Actual result:
process is not defined
(Bug) Potential fix:
This is a similar issue to reduxjs/redux#2907 which I fixed in reduxjs/redux#3143 that correctly generates an ES bundle.
I went ahead and did this locally, but I saw your es/ folder output actually contains all tsc build targets. The fix would therefore be impossible if someone would directly use es/StateNode.ts.
I would propose to generate a new bundle called es/index.mjs just like Redux, but with the reference to process removed.
The text was updated successfully, but these errors were encountered:
Bug or feature request?
Bug
Description:
In
StateNode.ts
, there is a reference toprocess
. Since a web browser does not have this variable, you can not load xstate using ES modules in a browser.(Bug) Expected result:
I can load xstate using ES modules in a browser
(Bug) Actual result:
process is not defined
(Bug) Potential fix:
This is a similar issue to reduxjs/redux#2907 which I fixed in reduxjs/redux#3143 that correctly generates an ES bundle.
I went ahead and did this locally, but I saw your
es/
folder output actually contains alltsc
build targets. The fix would therefore be impossible if someone would directly usees/StateNode.ts
.I would propose to generate a new bundle called
es/index.mjs
just like Redux, but with the reference toprocess
removed.The text was updated successfully, but these errors were encountered: