Skip to content

Build output is missing the index.d.cts file causing typescript to fail #2098

Closed
@aorsten

Description

@aorsten

openapi-react-query version

0.2.9

Description

The build output is missing the .d.cts file for Require.types settings in package.json.

Reproduction

Trying to

import { createClient } from 'openapi-react-query'
// Could not find a declaration file for module 'openapi-react-query'. '.../node_modules/openapi-react-query/dist/index.cjs' implicitly has an 'any' type.

From package.json I see:

  "exports": {
    ".": {
      "import": {
        "types": "./dist/index.d.ts",
        "default": "./dist/index.js"
      },
      "require": {
        "types": "./dist/index.d.cts", // THIS SETTING
        "default": "./dist/index.cjs"
      }
    },
    "./*": "./*"
  },

But it does not exist in node modules (openapi-fetch for comparison):

image

Expected result

I am unsure how exactly to fix this, but clearly for me the file is missing from the build output. Can you add it?

Extra

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingopenapi-react-queryRelevant to openapi-react-query

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions