You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I also want to protect some pages when users are not signed in. I'm using the middleware approach as described in the Protecting Resources section of the docs.
My middleware.ts:
export{authasmiddleware}from"@/auth"
When I try to run the app, I get the following error:
Module build failed: UnhandledSchemeError: Reading from "node:process" is not handled by plugins (Unhandled scheme).
Webpack supports "data:" and "file:" URIs by default.
You may need an additional plugin to handle "node:" URIs.
Import trace for requested module:
node:process
./node_modules/google-logging-utils/build/src/logging-utils.js
./node_modules/google-logging-utils/build/src/index.js
./node_modules/gcp-metadata/build/src/index.js
./node_modules/google-auth-library/build/src/index.js
./node_modules/google-gax/build/src/fallback.js
./node_modules/@google-cloud/firestore/build/src/index.js
./node_modules/firebase-admin/lib/firestore/index.js
./node_modules/firebase-admin/lib/esm/firestore/index.js
./node_modules/@auth/firebase-adapter/index.js
./src/auth.ts
I figured out that it's because firebase-admin is being imported in the auth.ts (for the config to the adapter) so if I don't use the adapter or don't import it in middleware.ts the app works.
How can I make both the middleware an FirestoreAdapter work at the same time?
I'm on Next 15
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using a Firebase adapter in my NextAuth config as described in the docs:
I also want to protect some pages when users are not signed in. I'm using the middleware approach as described in the Protecting Resources section of the docs.
My middleware.ts:
When I try to run the app, I get the following error:
I figured out that it's because firebase-admin is being imported in the
auth.ts
(for the config to the adapter) so if I don't use the adapter or don't import it inmiddleware.ts
the app works.How can I make both the middleware an FirestoreAdapter work at the same time?
I'm on Next 15
Beta Was this translation helpful? Give feedback.
All reactions