blitz-js / babel-plugin-superjson-next

Automatically transform your Next.js Pages to use SuperJSON
MIT License
125 stars 15 forks source link

Get layout is not working anymore after adding plugin #129

Closed Haberkamp closed 1 year ago

Haberkamp commented 1 year ago

I've added the plugin to my next.js app and fetching dates worked fine but the layouts we're missing completely.

next.js version: 12.2.4 superjson version: 1.9.1 babel-plugin-superjson-next version: 0.4.3

Skn0tt commented 1 year ago

Hi @Haberkamp! Could you share a reproduction repository? That'd make it a lot easier for me to reproduce this.

Haberkamp commented 1 year ago

Yes! Here you go. After starting the server visit the /layout route. When you comment out the getServerSideProps variable of that page you'll be able to see the layout again.

Skn0tt commented 1 year ago

thx for the repro! I was able to reproduce and fix the error, it had to do with the order of the code emitted by this babel plugin.

@all-contributors please add @Haberkamp for bug

allcontributors[bot] commented 1 year ago

@Skn0tt

I've put up a pull request to add @Haberkamp! :tada:

Skn0tt commented 1 year ago

published in https://github.com/blitz-js/babel-plugin-superjson-next/releases/tag/v0.4.4 :)

Haberkamp commented 1 year ago

Yea thank you!