Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

fix: update dial function return type to avoid Connection import issue #171

Merged
merged 1 commit into from
Aug 10, 2022

Conversation

nickreynolds
Copy link
Contributor

  • I've noticed an issue when including this package in another typescript project. The index.d.ts file created during the build process would include an in-line import in the dial function declaration of Promise<import("@libp2p/interface-connection/dist/src").Connection>;
  • This would result in the following build error in my project:
    ../../node_modules/@libp2p/websockets/dist/src/index.d.ts(19,104): error TS2694: Namespace '"@libp2p/interface-connection/dist/src"' has no exported member 'Connection'.
  • By declaring the Connection import explicitly, we avoid the strange in-line import of a dist/src location and I am able to build my project correctly.

I believe it is possible that this issue: #163 is also the result of the behavior I was seeing, and this PR may resolve that issue.

@achingbrain
Copy link
Member

Thanks for opening this, I'm not sure why tsc gets the import paths wrong. Hopefully merging this will prevent this sort of thing in the future.

@achingbrain achingbrain merged commit 7ea9f83 into libp2p:master Aug 10, 2022
github-actions bot pushed a commit that referenced this pull request Aug 10, 2022
## [3.0.2](v3.0.1...v3.0.2) (2022-08-10)

### Bug Fixes

* update all deps ([#176](#176)) ([4825cd7](4825cd7))
* update dial function return type to avoid Connection import issue ([#171](#171)) ([7ea9f83](7ea9f83))
@github-actions
Copy link

🎉 This PR is included in version 3.0.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants