kstulgysOriginal post
Rank 2: Process
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
Summary
The user is experiencing an error: "Adapter 'http' is not available in the build" in their Next.js middleware. The middleware code includes importing modules and creating instances of 'Client' and 'Users' from 'node-appwrite'. The error occurs during server runtime.
Unfortunately, the support thread does not provide a solution to the error. To address this issue, the user can try the following steps:
1. Check the compatibility of the 'node-appwrite' SDK and the runtime environment.
2. Ensure that the 'http' adapter is available in the build and compatible with the runtime environment.
3. Consult the documentation or support