Skip to content

fix: Add peer id str to mismatch error #273

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

Merged
merged 2 commits into from
Feb 20, 2023
Merged

Conversation

dapplion
Copy link
Contributor

@dapplion dapplion commented Feb 14, 2023

BEGIN_COMMIT_OVERRIDE
fix: Add peer id str to mismatch error
END_COMMIT_OVERRIDE

@dapplion dapplion requested a review from a team as a code owner February 14, 2023 05:06
@dapplion dapplion changed the title Add peer id str to mismatch error chore: Add peer id str to mismatch error Feb 14, 2023
@mpetrunic
Copy link
Member

@dapplion Could you update test case expected error message^^

@wemeetagain
Copy link
Member

Really dislike tests like this, that check against specific string literals. Prone to breaking on updates and not much value add there.
Would be in favor of using CodeError and refactoring the test to check the err.code.

@dapplion
Copy link
Contributor Author

Cannot run tests locally, currently stuck building the library with

[21:35:54] tsc [started]
error TS2688: Cannot find type definition file for 'keyv'.
  The file is in the program because:
    Entry point for implicit type library 'keyv'


Found 1 error.

[21:35:55] tsc [failed]
[21:35:55] → Command failed with exit code 1: tsc

@mpetrunic
Copy link
Member

Cannot run tests locally, currently stuck building the library with

[21:35:54] tsc [started]
error TS2688: Cannot find type definition file for 'keyv'.
  The file is in the program because:
    Entry point for implicit type library 'keyv'


Found 1 error.

[21:35:55] tsc [failed]
[21:35:55] → Command failed with exit code 1: tsc

I cannot replicate that, have you tried deleting node_modules and package-lock.json?

@dapplion
Copy link
Contributor Author

dapplion commented Feb 20, 2023

removing package-lock.json did not fix the issue, but removing node_modules did. Why? Can we please commit package-lock.json to all of our repos? The DX is terrible. We never have this types of issues in the Lodestar monorepo

@mpetrunic
Copy link
Member

removing package-lock.json did not fix the issue, but removing node_modules did. Why? Can we please commit package-lock.json to all of our repos? The DX is terrible. We never have this types of issues in the Lodestar monorepo

Not 100%, but I think because it prefers to use the local version instead of the latest one.
Solution should not be to remove node_modules but to bump the package in package.json to minimum acceptable version.

Putting lockfiles in the repo would indeed resolve this problem for us but that could still happen to users of js-libp2p-noise in case some other package they use depends on a specific version that we find acceptable even though it isn't.

@mpetrunic
Copy link
Member

keyv

In specific case, it cannot happen to the user as this is dev dependecy^^

Would be nice if there would be support to lockfile dev dependency only^^

@mpetrunic mpetrunic merged commit 1990c6f into master Feb 20, 2023
@mpetrunic mpetrunic deleted the dapplion/peerid-match-error branch February 20, 2023 09:45
@mpetrunic mpetrunic changed the title chore: Add peer id str to mismatch error fix: Add peer id str to mismatch error Feb 20, 2023
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