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 TypeScript declaration file path for @asgardeo/auth-react module to resolve TS7016 error #254

Merged
merged 1 commit into from
Oct 16, 2024

Conversation

lakpahana
Copy link
Contributor

Purpose

I encountered a TypeScript error (TS7016) where it couldn't find a declaration file for the @asgardeo/auth-react module. This happened because the path to the type definition file was incorrect in the module's package.json.

Goals

The goal was to fix the incorrect path in package.json so TypeScript could locate the correct type definition file and avoid assigning an implicit any type to the module.

Approach

  1. Initially, the package.json had this:
    "types": "dist/src/index.d.ts"
  2. I changed it to:
    "types": "dist/types/src/index.d.ts"

This fixed the error by pointing to the correct type file.

Learning

I used the TypeScript documentation to understand how to configure the types field in package.json. It explained how TypeScript looks for type files when a module is imported, helping me identify and correct the issue.

Copy link
Contributor

@pavinduLakshan pavinduLakshan left a comment

Choose a reason for hiding this comment

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

LGTM.

Thanks @lakpahana for the PR.

@pavinduLakshan pavinduLakshan merged commit d887729 into asgardeo:main Oct 16, 2024
2 checks 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