I am utilizing Next.JS with next-auth, and unfortunately have to apply a patch to the next-auth package due to use behind a corporate proxy, a tutorial for which is outlined here.
I'll paste the code here for reference as well:
var _openidClient = require("openid-client");
var proxyAgent = require("https-proxy-agent");
async function openidClient(options) {
const provider = options.provider;
let httpOptions = {};
if (provider.httpOptions) httpOptions = { ...provider.httpOptions };
if (process.env.http_proxy) {
let agent = new proxyAgent.HttpsProxyAgent(process.env.http_proxy); // problematic line
httpOptions.agent = agent;
}
// rest of the function
}
This was and has been working fine until the recent 7.0.3 release, in which I actually can't get any of my routes to load due to the above usage of https proxy agent because of the following error:
node:url Module build failed: UnhandledSchemeError: Reading from "node:url" is not handled by plugins
Webpack supports "data:" and "file:" URIs by default.
You may need an additional plugin to handle "node:" URIs.
Unfortunately reproducing this would be kind of difficult, but if one really wanted to you'd have to set up next-auth in a next.js project with this https-proxy-agent utilizing linked patch, and this particular piece of code specifically relates to using Microsoft Entra Id for Oauth Sign in.
I can downgrade to 7.0.2 and all is well. If there's something I can change in my code I'm happy to do so, but It's not readily apparent to me what happened.
I am utilizing Next.JS with next-auth, and unfortunately have to apply a patch to the next-auth package due to use behind a corporate proxy, a tutorial for which is outlined here.
I'll paste the code here for reference as well:
This was and has been working fine until the recent 7.0.3 release, in which I actually can't get any of my routes to load due to the above usage of https proxy agent because of the following error:
Unfortunately reproducing this would be kind of difficult, but if one really wanted to you'd have to set up next-auth in a next.js project with this https-proxy-agent utilizing linked patch, and this particular piece of code specifically relates to using Microsoft Entra Id for Oauth Sign in.
I can downgrade to 7.0.2 and all is well. If there's something I can change in my code I'm happy to do so, but It's not readily apparent to me what happened.