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

[Bug][TS] Cannot return typed response via defineEventHandler #89

Closed
Rigo-m opened this issue Apr 8, 2022 · 4 comments
Closed

[Bug][TS] Cannot return typed response via defineEventHandler #89

Rigo-m opened this issue Apr 8, 2022 · 4 comments
Assignees

Comments

@Rigo-m
Copy link

Rigo-m commented Apr 8, 2022

See type error here

@Rigo-m
Copy link
Author

Rigo-m commented Apr 8, 2022

@pi0 was trying to migrate from defineHandler, could you help?

@pi0
Copy link
Member

pi0 commented Apr 8, 2022

Should be solved in the last release.

@pi0 pi0 closed this as completed Apr 8, 2022
@chrisxvin
Copy link

Still same error with 0.7.4

@chrisxvin
Copy link

chrisxvin commented Apr 22, 2022

It seems cannot assign object array to H3Response type.
ts(2345): Cannot assign "IMyInterface" to type "string | number | boolean"

defineEventHandler(event => {
    const data: IMyInterface[] = [];
    return data;
});

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 a pull request may close this issue.

4 participants