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
That is to be expected, you have a circular dependency in your files
entry.js -> actions.js -> store.js -> actions.js
When store.js loads action.js, it is already in the queue, but hasn't executed yet because it is waiting for store.js to finish. Now because store.js depends on actions.js, but it is already loading, it will run store.js. The imported value actionTypes is undefined because actions.js hasn't executed yet.
In a real ES6 environment, this would throw a temporal deadzone error, but Babel does not support them in this case.
Your best bet would be to instead make store.js be:
export {actionTypes as default} from './actions';
so that the value is re-exported directly. This will take advantage of live bindings and avoids actually accessing the value of actionTypes until after actions has executed.
The text was updated successfully, but these errors were encountered:
babel/babel#4094
That is to be expected, you have a circular dependency in your files
entry.js -> actions.js -> store.js -> actions.js
When store.js loads action.js, it is already in the queue, but hasn't executed yet because it is waiting for store.js to finish. Now because store.js depends on actions.js, but it is already loading, it will run store.js. The imported value actionTypes is undefined because actions.js hasn't executed yet.
In a real ES6 environment, this would throw a temporal deadzone error, but Babel does not support them in this case.
Your best bet would be to instead make store.js be:
export {actionTypes as default} from './actions';
so that the value is re-exported directly. This will take advantage of live bindings and avoids actually accessing the value of actionTypes until after actions has executed.
The text was updated successfully, but these errors were encountered: