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
- Failed to generate functions SSL
```appwrite-worker-certificates | Cannot renew domain (functions.domain.com) on attempt no. 9 certificate: Failed to verify domain DNS records. appwrite-worker...
- Dart 3.10 runtime on self-host 1.8.1
I added dart-3.10 runtime in .env file, applied the changes, but cannot see such option on console. is dart 3.10 not supported by self hosted 1.8.1? if not, whe...
- Guideline of AI
Hello everyone, I’m planning to specialize in Artificial Intelligence (AI) and I’m currently looking for guidance from someone with strong experience in the fi...