Open emyot opened 11 months ago
Ignore this report, I'm having this issues when using the esmodule but when I switched to vite I no longer have this problems at all.
Had the same issue once, don't remember where I found the fix but this solved a similar error for me:
import * as toolkitRaw from "@reduxjs/toolkit";
const { configureStore } = toolkitRaw.default ?? toolkitRaw;
What version of Remix are you using?
2.2.0
Are all your remix dependencies & dev-dependencies using the same version?
Steps to Reproduce
index.ts file in the store directory
// import { configureStore, combineReducers } from "@reduxjs/toolkit";
import pkg from "@reduxjs/toolkit"; const { configureStore, combineReducers } = pkg;
import skillNumArrSlice from "./skill-slice"; import workExpSlice from "./workExp-slice"; import certificateSlice from "./certificate-slice"; import eductBGSlice from "./eductBG-slice"; import parentInfoSlice from "./parentInfo-slice"; import charRefSlice from "./charReference-slice"; import basicInfoLanguageSlice from "./basicInfo-Language-slice";
const allReducers = combineReducers({ workExp: workExpSlice.reducer, certificate: certificateSlice.reducer, eductBG: eductBGSlice.reducer, parentInfo: parentInfoSlice.reducer, charRef: charRefSlice.reducer, skillNumArr: skillNumArrSlice.reducer, basicInfoLangStateArr: basicInfoLanguageSlice.reducer, });
export type RootState = ReturnType;
const store = configureStore({ reducer: { workExp: workExpSlice.reducer, certificate: certificateSlice.reducer, eductBG: eductBGSlice.reducer, parentInfo: parentInfoSlice.reducer, charRef: charRefSlice.reducer, skillNumArr: skillNumArrSlice.reducer, basicInfoLangStateArr: basicInfoLanguageSlice.reducer, }, });
export default store;
root.tsx route file in app directory import { cssBundleHref } from "@remix-run/css-bundle"; import type { LinksFunction } from "@remix-run/node"; import { Links, LiveReload, Meta, Outlet, Scripts, ScrollRestoration, } from "@remix-run/react";
import { Provider } from "react-redux";
import store from "./store";
export const links: LinksFunction = () => [ ...(cssBundleHref ? [{ rel: "stylesheet", href: cssBundleHref }] : [ { rel: "stylesheet", href: "https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css", }, ]), ];
interface Props { children: React.ReactNode; }
const Document = ({ children }: Props) => { return (
); };
export default function App() { return (
); }
Expected Behavior
To run without errors.
Note: Don't have any problems in the pervious Remix version before 2.0
Actual Behavior
It's giving me this error:
C:\Users\admin\Documents\Remix-Projects\remix-v2-testapp>npm run dev
�💿 remix d
info building... X [ERROR] Build failed with 1 error:
app/store/index.ts:3:7: ERROR: No matching export in "node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js" for import "default" [plugin css-bundle-plugin]