react-dom.production.min.js:106 Uncaught TypeError: Cannot redefine property: default #2174
Unanswered
vaynevayne
asked this question in
Bug report
Replies: 3 comments 4 replies
-
|
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Can you reproduce the issue with https://codesandbox.io/s/react-new ? |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
This error only occurs after the build, and the Can you help me empirically see if it's a tsconfig issue? return createStore<PageState>()((set) => ({
...DEFAULT_PROPS,
...initProps,
set,
addTab: (tabData) =>
set((state) => ({
tabs: {
...state.tabs,
items: state.tabs.items.concat({ ...tabData }),
activeKey: tabData.key,
},
})),
removeTab: (targetKey: TargetKey) =>
set((state) => {
console.log('state', state)
const nextState = produce(state, (draft) => {
const targetIndex = draft.tabs.items?.findIndex((pane) => pane.key === targetKey) || -1
const newPanes = draft.tabs.items?.filter((pane) => pane.key !== targetKey)
if (newPanes?.length && targetKey === draft.tabs.activeKey) {
const { key } =
newPanes[targetIndex === newPanes.length ? targetIndex - 1 : targetIndex]
draft.tabs.activeKey = key
}
draft.tabs.items = newPanes
})
console.log('nextState', nextState)
return nextState
}),
})){
"compilerOptions": {
"target": "ESNext",
"useDefineForClassFields": true,
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"allowJs": false,
"skipLibCheck": true,
"esModuleInterop": false,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"suppressImplicitAnyIndexErrors": true,
"module": "ESNext",
"moduleResolution": "Node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"noImplicitAny": false,
"jsx": "react-jsx",
"baseUrl": "./",
"paths": {
"@/*": ["./src/*"]
}
},
"include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }]
} |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
-
dev environment, no errors,
In the production environment,
it will generate the error as shown in the picture, I'm not sure if it's a packaging error of zustand for the middleware?
Beta Was this translation helpful? Give feedback.
All reactions