gladly-team / next-firebase-auth

Simple Firebase authentication for all Next.js rendering strategies
https://nfa-example-git-v1x-gladly-team.vercel.app/
MIT License
1.35k stars 290 forks source link

Module not found: @babel/runtime #399

Closed dubisdev closed 2 years ago

dubisdev commented 2 years ago

Describe the bug I'm getting an error after updating NextJS version:

error - ./node_modules/next-firebase-auth/build/index.browser.js:1:1496
Module not found: Can't resolve '@babel/runtime/helpers/objectWithoutProperties'

Import trace for requested module:
./services/initAuth.js
./pages/_app.js

Versions

next-firebase-auth version: 1.0.0-canary.4 Firebase JS SDK:

Next.js: 12.0.8-canary.13 (updated from 12.0.7)

To Reproduce Steps to reproduce the behavior:

  1. Create a project following your guide
  2. Use next 12.0.8-canary.13
  3. See error

Expected behavior Should work, but fails.

Additional context It seems NextJS is pre-compiling its dependencies and now @babel/runtime has been precompiled so it is not available and must be set as dependency in your package. https://babeljs.io/docs/en/babel-plugin-transform-runtime

Temporary fix Install the package as a dependency in the webpage project: yarn add @babel/runtime or npm i @babel/runtime (then it works).

Thank you very much for this great package, it is really useful 📈🚀

kmjennison commented 2 years ago

Fixed in #501.