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: Fixed undici-types error by updating the dependecy #1008

Merged
merged 1 commit into from
Jun 11, 2024

Conversation

gyaneshgouraw-okta
Copy link
Contributor

@gyaneshgouraw-okta gyaneshgouraw-okta commented May 28, 2024

Changes

Please describe both what is changing and why this is important. Include:

  • Added a new dependency of undici-types to fix the issue Error when trying to compile TypeScript project: Cannot find module 'undici' or its corresponding type declarations. #1007
  • This typescript error was happening as undici which also contains it's type was part of dev dependecy
  • However client typescript app not having undici dependecy was running into ts error
  • Explicit undici-types as dependecy will not be required once @types/node is updated to 20.*.*
  • Classes and methods added, deleted, deprecated, or changed
  • Any alternative designs or approaches considered
    • Updating @types/node to 20.*.*, which explicitly has undici-types however this will be a major change, and should be only done when this sdk is qualified to support nodeJS 20.*.*
    • Moving undici to dependency list from dev-dependency, however this will give an impression that we are extensively using undici currently, which is not the case, so just opted for undici-types

References

Please include relevant links supporting this change such as a:

Testing

Please describe how this can be tested by reviewers. Be specific about anything not tested and reasons why. If this library has unit and/or integration testing, tests should be added for new functionality and existing tests should complete without errors.

  • Step 1 - auth0-node

    • On the current branch, with the changes ran - npm run build
    • Copied the generated dist folder
  • Step 2 - ClientApp setup

    • Create a TypeScript project using gts.
    • Run npm install auth0.
    • Updated node_modules->auth0-> dist with copied dist from step1
    • Add the following line to the index.ts file: import * as auth0 from 'auth0';
    • Run npm run compile or, alternatively, tsc.
    • No error was seen, if we don't copy the dist folder error will be seen
  • This change adds unit test coverage

  • This change adds integration test coverage

Checklist

Copy link
Contributor

@nandan-bhat nandan-bhat left a comment

Choose a reason for hiding this comment

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

Changes look good. Approved!

@stevekanter
Copy link

@nandan-bhat or @frederikprijck is there a plan to release this? I'm having the same trouble and it sounds like this fix exists and are approved but haven't been released 10+ days later

@gyaneshgouraw-okta
Copy link
Contributor Author

Hey @stevekanter, we are planning to get this PR merged and released by this week.

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.

3 participants