Closed ThePaulMcBride closed 3 years ago
If you are using yarn, what's the output of yarn why babel-plugin-superjson-next
?
➜ yarn why babel-plugin-superjson-next
yarn why v1.22.10
[1/4] 🤔 Why do we have the module "babel-plugin-superjson-next"...?
[2/4] 🚚 Initialising dependency graph...
[3/4] 🔍 Finding dependency...
[4/4] 🚡 Calculating file sizes...
=> Found "babel-plugin-superjson-next@0.2.1"
info Reasons this module exists
- "blitz#@blitzjs#babel-preset" depends on it
- Hoisted from "blitz#@blitzjs#babel-preset#babel-plugin-superjson-next"
info Disk size without dependencies: "80KB"
info Disk size with unique dependencies: "184KB"
info Disk size with transitive dependencies: "6.49MB"
info Number of shared dependencies: 7
This is so odd. Could we get access to your repo by chance?
I've also just run a few sanity checks, and couldn't find the issue. Access to the repo / a reproduction would be great.
Sure. I've temporarily made the repo public. I'm a Typescript noob, so don't judge me too harshly.
You have a .babelrc
that contains "plugins": ["superjson-next"]
in your root directory. Since blitz/babel
also includes this, it is now applied twice. Remove .babelrc
to fix.
Ahh you're right. I'm a dumbass! Thank you so much for the help!
@ThePaulMcBride you're not a dumbass. Dev is just hard :)
Recently upgraded to Blitz v0.3.0 then v.0.3.1 and have run into issues with superjson. Following a chat with @flybayer I removed superjson from my
.babelrc
file as it should now be handled by Blitz.My page code is below and is at the following path
app/pages/jobs/[companySlug]/[jobSlug].tsx
I would expect the props passed to the page to be an object containing a
company
and ajob
. However, the data I am getting is insteadSuperjson is clearly doing something here, but it doesn't seem to pass props to the page component how I would expect.