Skip to content

Typescript errors when trying to accept Context type in 3rd party package #2215

Answered by yusukebe
travierm asked this question in Q&A
Discussion options

You must be logged in to vote

I am sorry if I am wrong too.

What you are trying to do is the same as HonoX or 3rd party Middleware. So please refer to that.

https://github.com/honojs/middleware/tree/main/packages/zod-validator

That is, put hono in your package's devDependencies and do not include hono in your package's dependencies. Users will install hono with your package when they use it.

npm i enzo-core hono

This way, user applications can refer to the same hono and there will be no type errors.

Replies: 5 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@travierm
Comment options

@yusukebe
Comment options

Answer selected by travierm
@travierm
Comment options

@yusukebe
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants