blitz-js / babel-plugin-superjson-next

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

Example server crashes #4

Closed blakeley closed 3 years ago

blakeley commented 3 years ago

The Next.js server provided in /example crashes soon after starting.

Steps to reproduce:

  1. git clone https://github.com/blitz-js/babel-plugin-superjson-next
  2. cd babel-plugin-superjson-next/example
  3. yarn install
  4. npm run dev

Expected behavior: Server boots up without any errors, and visiting localhost:3000 displays "props.date is Date: (date)"

Actual behavior: Server boots, but then errors very soon after with the following trace:

ready - started server on http://localhost:3000
error - ./node_modules/next/dist/client/next-dev.js
Error: Cannot find module 'babel-plugin-superjson-next' from '/Users/blakeley/Desktop/babel-plugin-superjson-next/example'
    at Array.map (<anonymous>)
Skn0tt commented 3 years ago

Thanks for reporting the issue! I'll look into it.

Skn0tt commented 3 years ago

Could you try it again? I guess something in yarn.lock was wrong, I fixed it in aaddf3e206563665aaf210762a30557843b6364d.

blakeley commented 3 years ago

I followed the steps above again with that commit, but I'm still seeing the same error. I also tried rm yarn.lock & yarn and then tried booting the server again, but got the same error again.

Skn0tt commented 3 years ago

Couldn't reproduce on a blank VM. Can you provide a reproduction repo?

blakeley commented 3 years ago

Sure, here's a reproduction repo: https://github.com/blakeley/babel-plugin-superjson-next

Although note that didn't actually change anything to cause this error, so there's no difference between that repo and origin/master here

Skn0tt commented 3 years ago

Oh wow, I should have thought that through 😅 Obvsly a repro repo doesn’t help, sorry. What OS are you on? Node / Yarn / NPM version?

blakeley commented 3 years ago

macOS Catalina - 10.15.6 node -v v12.16.1 yarn -v 1.22.4 npm -v 6.14.8

flybayer commented 3 years ago

Note: you have to run yarn build in the repo root before trying to run the example. It appears that is the issue here maybe