Skip to content

Default export of the module has or is using private name type error when using latest alpha + declaration: true #3455

@vidarc

Description

@vidarc
import { createSlice } from "@reduxjs/toolkit";

export default createSlice({
  name: "hello",
  initialState: {},
  reducers: (create) => ({
    somePreparedReducer: create.preparedReducer(
      (state: string) => {
        return { payload: { state } };
      },
      (state, action) => {
        state = { something: action.payload };
      }
    ),
  }),
});

with a tsconfig of

{
  "compilerOptions": {
    "declaration": true
  }
}

produces the following two errors

Default export of the module has or is using private name 'ReducerType'.ts(4082)
Default export of the module has or is using private name 'reducerDefinitionType'.ts(4082)

With declaration set to false, the error goes away, but that isn't workable since I am writing a library.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions