Error: The request failed and the interceptors did not return an alternative response

Hi, I am trying to use the NodeJS package but it’s giving an error with no resolution found.

This is the basic code:

import { ManagementClient } from "auth0";

export const management = new ManagementClient({
	domain: ...,
	clientId: ...,
	clientSecret: ...,
});

import { management } from "@/lib/auth0Client";
import { NextRequest, NextResponse } from "next/server";

export async function GET(req: NextRequest) {
	try {
		const data = await management.users.get({ id: "105277673537276314057" });

		console.log(data);
		return NextResponse.json({ ok: true });
	} catch (e) {
		console.log(e);
		return NextResponse.json({ ok: false });
	}
}

But it returns an error with this message: “The request failed and the interceptors did not return an alternative response”

Hi @office2

Welcome to the Auth0 Community!

Thank you for posting your question,

Can you confirm for me that your domain, clientID and clientSecret are correct and match those provided in the Auth0 Dashboard and your application has permissions to access this user information?

Thanks
Dawid

For me,
I was adding “https://” as part of domain name when passing it to the ManagementClient constructor and it was causing the issue. Try removing that and try again.