blitz-js / babel-plugin-superjson-next

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

cleanup & compatibility fixes #39

Closed iffa closed 3 years ago

iffa commented 3 years ago

reason for these changes:

# with current @latest version:
error - ./node_modules/next/dist/client/next-dev.js
Error: Cannot find module '@babel/core'
Require stack:
- node_modules\babel-plugin-superjson-next\dist\index.js

# with changes from this PR:
ready - started server on http://localhost:3000
info  - Using external babel configuration from .babelrc
event - compiled successfully

can be reproduced with the basic project setup from create-next-app.

Skn0tt commented 3 years ago

I'm surprised that this resolves Error: Cannot find module '@babel/core'. Adding @babel/core to devDependencies shouldn't change anything since devDependencies aren't downloaded, anyway - what am I missing?

iffa commented 3 years ago

The reason this resolves the issue is due to the import declaration changes I made (types not imported from @babel/core but directly). The devDependencies-additions are probably unnecessary but I added them to be explicit. I can push some changes to the PR if you'd like.

Skn0tt commented 3 years ago

Thanks for explaining! That makes sense ☺️ Don't worry, I'll make the last few necessary edits myself :D

Skn0tt commented 3 years ago

@allcontributors add iffa for code

allcontributors[bot] commented 3 years ago

@Skn0tt

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