Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add types to exports in package.json #9

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nigimaxx
Copy link

@nigimaxx nigimaxx commented Apr 8, 2024

No description provided.

@aalin
Copy link

aalin commented Aug 2, 2024

I'm getting the following error when building my app:

Type error: Could not find a declaration file for module '@imgproxy/imgproxy-js-core'. '/Users/andreas/Projects/the-project/node_modules/@imgproxy/imgproxy-js-core/dist/imgproxy-js-core.mjs' implicitly has an 'any' type.
  There are types at '/Users/andreas/Projects/the-project/node_modules/@imgproxy/imgproxy-js-core/dist/imgproxy-js-core.d.ts', but this result could not be resolved when respecting package.json "exports".
  The '@imgproxy/imgproxy-js-core' library may need to update its package.json or typings.

This PR fixes the build. Is there any way I can get TypeScript to find the definitions until this PR has been merged and released?

UPDATE

Changing tsconfig.json to include the path to the definition file seems to work.

{
  "compilerOptions": {
    "paths": {
      "@imgproxy/imgproxy-js-core": ["./node_modules/@imgproxy/imgproxy-js-core/dist/imgproxy-js-core.d.ts"],
    }
  }
}

@DarthSim DarthSim requested a review from Alqanar November 6, 2024 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants