You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
User Config: modules, app, components, routeRules, runtimeConfig
Runtime Modules: @nuxtjs/google-fonts@3.0.0
Build Modules: -
Reproduction
Somebody over in Nuxt issues made this, though the issue was closed in the Nuxt forum and explicitly deferred to Nitro, though I don't see a respective issue here (sorry if I missed it). Essentially, people including me are confused about how to exchange data from API to frontend because a mysterious SerializeObject type is wrapped around it. What will and won't be converted to this? how do we undo this or otherwise process this?
Specifically: When I write an API event handler that returns an array of a prisma type, and consume that type with the nuxt useFetch composable in the frontend, it's wrapped in SerializeObject<CorrectType[]>, and typescript says this backend data is unassignable to a variable of the type that was sent.
Additional context
Here's the Intellisense that is generated in VS Code
Logs
No response
The text was updated successfully, but these errors were encountered:
Otherwise you can read #1002. This should end up converting types to valid JSON (which is what gets output anyway). If it's not working (ie. stripping valid types) then please do provide a reproduction. 🙏
Looking for support for alternative serializer, this would avoid re-writing/ updates types where date is involved. Especially where types are auto-generated, like Prisma.
Right now, every type on front end has to be wrapped with Serialize from nitropack to match returned data type.
Environment
Windows_NT
v18.15.0
3.3.2
2.3.2
npm@9.6.2
vite
modules
,app
,components
,routeRules
,runtimeConfig
@nuxtjs/google-fonts@3.0.0
-
Reproduction
Somebody over in Nuxt issues made this, though the issue was closed in the Nuxt forum and explicitly deferred to Nitro, though I don't see a respective issue here (sorry if I missed it). Essentially, people including me are confused about how to exchange data from API to frontend because a mysterious SerializeObject type is wrapped around it. What will and won't be converted to this? how do we undo this or otherwise process this?
https://stackblitz.com/edit/github-xbwzpm?file=server%2Fapi%2Ftest.ts
Describe the bug
Specifically: When I write an API event handler that returns an array of a prisma type, and consume that type with the nuxt useFetch composable in the frontend, it's wrapped in
SerializeObject<CorrectType[]>
, and typescript says this backend data is unassignable to a variable of the type that was sent.Additional context
Here's the Intellisense that is generated in VS Code
Logs
No response
The text was updated successfully, but these errors were encountered: