-
Notifications
You must be signed in to change notification settings - Fork 14
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
Support of non-default object types #80
Comments
We've also got a need for Decimal.js support (and some other internal/misc types). Feels like we need some sort of "bring-your-own-superjson" support where we can provide the instance or ensure our type registrations happen before this plugin uses superjson. I tried to hack this into the plugin with this commit. I'm not a rust guy, but steps I used to build were:
|
I'm migrating a In the
For the
it gives me the Does the |
Any updates on this, @orionmiz? It's a huge blocker for me with upgrading to the app router. |
any updates on this @orionmiz? |
If anyone else stumbles upon this issue, i was able to solve it by ensuring i register the serializer/deserializer in both client and server components manually. -----in server component (in my case, layout.tsx)----
-----in client component (in my case, providers.tsx, rendered in the layout component)----
i couldn't find anything about it in the docs, though it is an expected requirement 🤷♂️ |
Verify Next.js canary release
Describe the bug
Non-default object types aren't picked up and you get the following error:
at Array.forEach ()
null
I followed the suggested custom recipe format and inject it near the root of my app:
Expected behavior
The
next-superjson-plugin
should function the same assuperjson
when called directly.Reproduction link
No response
Version
^0.5.7
Config
Additional context
I was able to follow the example from Superjson on adding custom types and can use superjson directly to serialize and then parse it back to the original object, but when using
data-superjson
it doesn't work and I get the error above.The text was updated successfully, but these errors were encountered: