Has no exported member 'combineReducers' (Next.js + redux-toolkit + alias + typescript )
Then i use alias in tsconfig, typescript not found combineReducers. But the application builds and runs fine.
CLI:
src/redux/rootReducer.ts:1:10 - error TS2305: Module '"../../node_modules/@reduxjs/toolkit/dist/typings"' has no exported member 'combineReducers'.
1 import { combineReducers } from '@reduxjs/toolkit'
rootReducer file:
import { combineReducers } from '@reduxjs/toolkit'
import globalReducer from './global'
export const rootReducer = combineReducers({
global: globalReducer,
})
export type RootState = ReturnType<typeof rootReducer>
tsconfig.json:
{
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true,
"jsx": "preserve",
"lib": ["dom", "es2017"],
"module": "esnext",
"moduleResolution": "node",
"noEmit": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"preserveConstEnums": true,
"removeComments": false,
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"target": "esnext",
"forceConsistentCasingInFileNames": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"isolatedModules": true,
"baseUrl": "./src",
"paths": {
"@features/*": ["features/*"],
"@pages/*": ["../pages/*"],
"@assets/*": ["assets/*"],
"@constants": ["constants"],
"@libs": ["libs"],
"@components": ["components"],
"@styles/*": ["styles/*"],
"@redux/*": ["redux/*"],
"@api/*": ["api/*"],
"@hooks/*": ["hooks/*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
}
If alias is disabled, it works fine.