I have this in my nextjs middleware:
import type { NextRequest } from 'next/server';
import { NextResponse } from 'next/server';
import { Client, Users } from 'node-appwrite';
const usersApiKey = process.env.APPWRITE_USERS_API_KEY!;
const client = new Client()
.setEndpoint(process.env.NEXT_PUBLIC_API_ENDPOINT!)
.setProject(process.env.NEXT_PUBLIC_ENDPOINT!)
.setKey(usersApiKey);
const users = new Users(client);
It build fine but fails on the server : Error: Adapter 'http' is not available in the build
What's the full stack trace?
Error: Adapter 'http' is not available in the build
at Client.call (file:///app/.next/server/src/middleware.js:2215:23)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Users.getPrefs (file:///app/.next/server/src/middleware.js:7520:16)
at async Object.middleware [as handler] (file:///app/.next/server/src/middleware.js:1368:23)
at async adapter (file:///app/.next/server/src/middleware.js:1266:20)
at async runWithTaggedErrors (file:///app/node_modules/next/dist/server/web/sandbox/sandbox.js:94:24)
at async NextNodeServer.runMiddleware (file:///app/node_modules/next/dist/server/next-server.js:1599:24)
at async Object.fn (file:///app/node_modules/next/dist/server/next-server.js:1743:42)
at async Router.execute (file:///app/node_modules/next/dist/server/router.js:315:32)
at async NextNodeServer.runImpl (file:///app/node_modules/next/dist/server/base-server.js:616:29)
Interesting...I think this middleware is running in some edge runtime which is incompatible with our SDK 🧐
Recommended threads
- Realtime with multiple connections
I need the Realtime on multiple Collections for diffrent applicational logic. So my question is: Is there a way to have only 1 Websocket connection or do I need...
- Can't login or deploy functions in Appwr...
Hello, since i updatet to the appwrite cli 6.1.0 i can't login or deploy functions with the cli. When i call the command: "appwrite get account --verbose" i ge...
- Create admin user?
I'm not really sure how this is supposed to work, I installed Appwrite through docker-compose and set it up. When I launched the app and went into it, I created...