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.34k stars 290 forks source link

Throw a more helpful error if `fetch` global does not exist #536

Closed kmjennison closed 2 years ago

kmjennison commented 2 years ago

Is your feature request related to a problem? Please describe.

We now support getUserFromCookies in a non-Next.js backend. Next.js provides a fetch polyfill, but other server environments might not, in which case a somewhat confusing "fetch is not defined" error could throw. Related ticket for documentation: #535

Describe the solution you'd like and how you'd implement it

Let's provide a meaningful error message if fetch is not defined when using it in our backend logic.

Is this a breaking change?

No.

Describe alternatives you've considered

None.

kmjennison commented 2 years ago

Closed in #544.