Heeth JainOriginal post
Web Developer
I am following SSR tutorial from Appwrite in Nextjs 14: https://appwrite.io/docs/products/auth/server-side-rendering
How do I get user details in the middleware?
I can get session cookie, but not sure how do I get the user from it?
const session = request.cookies.get(SESSION_COOKIE);
When I try to initialize Client() from node-appwrite, it throws this error:
node:stream
Module build failed: UnhandledSchemeError: Reading from "node:stream" 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.
Summary
Middleware query on retrieving user details in Next.js using Appwrite tutorial. Developer seeking help on extracting user details from session cookie in middleware. Facing error when initializing `Client()` from `node-appwrite`. Error message: Module build failed due to UnhandledSchemeError.