Skip to content

Error with tsc when attempting to import types from RTK Query using @reduxjs/toolkit 2.0.1 #3970

Closed
@ryerrappa

Description

@ryerrappa

Sample repo reproducing the issue can be found here: https://github.com/ryerrappa/rtk-query-type-import-issue

  • @reduxjs/tookit 2.0.1
  • Vite 5.0.0
  • Typescript 5.2.2
  • tsconfig moduleResolution "bundler"

Receive the following error when attempting to import the MutationTrigger type.

Cannot find module @reduxjs/toolkit/dist/query/react/buildHooks

Using vite with the following tsconfig.

{
  "compilerOptions": {
    "composite": true,
    "skipLibCheck": true,
    "module": "ESNext",
    "moduleResolution": "bundler",
    "allowSyntheticDefaultImports": true
  },
  "include": ["vite.config.ts"]
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions