5.0.0-beta.0 breaks ESM in redux-toolkit to 2.0.0-beta.3?..
avi-0 opened this issue · 5 comments
I got here from trying to fix reduxjs/redux-toolkit#1960 by switching my redux-toolkit to 2.0.0-beta.3, however I started getting the following error message
✘ [ERROR] No matching export in "node_modules/reselect/dist/reselect.mjs" for import "autotrackMemoize"
node_modules/@reduxjs/toolkit/dist/redux-toolkit.modern.mjs:4:109:
4 │ import { createSelector, createSelectorCreator as createSelectorCreator2, defaultMemoize as defaultMemoize2, autotrackMemoize, weakMapMemoize } from "reselect";
╵ ~~~~~~~~~~~~~~~~
on my Vite dev server as well as
export { createSelector, createSelectorCreator, defaultMemoize, autotrackMemoize, weakMapMemoize } from 'reselect';
^
SyntaxError: The requested module 'reselect' does not provide an export named 'autotrackMemoize'
at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:190:5)
on my backend Node server.
I have no idea about anything going on but I found out that reselect 5.0.0-beta.0 released literally an hour before I got myself into this, so I tried switching reselect to 5.0.0-alpha.2 and the issue is gone. Let me know if you need more information about my setup
Yep, I know :) about to put out a new RTK beta with a fix for that in literally the next couple minutes :)
also I'm honestly impressed anyone's even trying RTK 2.0 beta right now :) we get so little feedback.
what happened is I dedided to use Redux both on the client and on the server as a basis for a very simple multiplayer rollback networking system, so I was directed to that issue and trying 2.0 seemed easier than figuring out how to make the workaround work (it fixed createSlice but then addListener needed something too?..). fun fact this is literally my first redux project god help me
ty!