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

[Fix] Missing declaration file for module in ts #94

Merged
merged 1 commit into from
Jul 25, 2024
Merged

[Fix] Missing declaration file for module in ts #94

merged 1 commit into from
Jul 25, 2024

Conversation

joserealdev
Copy link
Contributor

Checklist

  • I have read the CONTRIBUTING doc.
  • I have added/updated unit tests to cover my changes.
  • Unit tests pass locally.
  • I have added appropriate documentation for my changes.
  • I have updated the README to reflect any changes that will affect the component's public API (if applicable).

Problem

When using the library in a Typescript project, I got the following error:

Could not find a declaration file for module 'react-hover-video-player'. '/Users/<path>/node_modules/react-hover-video-player/dist/index.mjs' implicitly has an 'any' type.
  There are types at '/Users/<path>/node_modules/react-hover-video-player/dist/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'react-hover-video-player' library may need to update its package.json or typings.ts(7016)

So I looked into the library locally, and adding the export inside the package.json made the error go away.

Solution

Export types in package.json

Copy link
Owner

@Gyanreyer Gyanreyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution! This looks great, I'll get it released shortly!

@Gyanreyer Gyanreyer merged commit 7284666 into Gyanreyer:main Jul 25, 2024
1 check passed
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