-
-
Notifications
You must be signed in to change notification settings - Fork 630
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
bug: types broken after setting a basepath #2832
Labels
Comments
I understood. Argument of type 'Hono<Env, BlankSchema, "/mybasepath">' is not assignable to parameter of type 'Hono<{}, { "/mybasepath/items": { $get: { input: {}; output: { id: number; }; outputFormat: "json"; status: 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226 | 300 | 301 | ... 47 more ... | -1; }; }; }, "/mybasepath">'.
Types of property 'fetch' are incompatible.
Type '(request: Request, Env?: {} | Bindings | undefined, executionCtx?: ExecutionContext | undefined) => Response | Promise<Response>' is not assignable to type '(request: Request, Env?: unknown, executionCtx?: ExecutionContext | undefined) => Response | Promise<Response>'.
Types of parameters 'Env' and 'Env' are incompatible.
Type 'unknown' is not assignable to type '{} | Bindings | undefined Env has two types of {} and unknown. |
hono/src/helper/testing/index.ts Line 18 in dfbc6c4
|
Explicitly |
ReturnType of ".get" is broken...? |
Either way, the returnType Env of .get will be unknown. |
@thenbe |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version of Hono are you using?
4.4.0
What runtime/platform is your app running on?
node
What steps can reproduce the bug?
Typescript playground repro: link
What is the expected behavior?
There should be a way to create a typed testClient when using a basepath.
What do you see instead?
testClient types are broken when using a basepath.
Additional information
No response
The text was updated successfully, but these errors were encountered: