You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am getting this error when running inside docker in my local machine. The same standalone production build run in my machine directly is working perfectly. I have checked the following issues but none of this help.
[auth][error] TypeError: fetch failed
at node:internal/deps/undici/undici:13178:13
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async [custom-fetch] (/app/apps/portal-ui/.next/server/chunks/447.js:379:64192)
at async ob (/app/apps/portal-ui/.next/server/chunks/447.js:379:46774)
at async o_ (/app/apps/portal-ui/.next/server/chunks/447.js:379:49648)
at async ox (/app/apps/portal-ui/.next/server/chunks/447.js:379:52290)
at async oP (/app/apps/portal-ui/.next/server/chunks/447.js:379:56446)
at async /app/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:36957
at async eC.execute (/app/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:27552)
at async eC.handle (/app/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:38291)
next dev run inside docker container trace:
[auth][error] TypeError: fetch failed
at node:internal/deps/undici/undici:13178:13
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async [custom-fetch] (webpack-internal:///(rsc)/../../node_modules/@auth/core/providers/microsoft-entra-id.js:126:34)
at async getAuthorizationUrl (webpack-internal:///(rsc)/../../node_modules/@auth/core/lib/actions/signin/authorization-url.js:25:35)
at async Module.signIn (webpack-internal:///(rsc)/../../node_modules/@auth/core/lib/actions/signin/index.js:16:56)
at async AuthInternal (webpack-internal:///(rsc)/../../node_modules/@auth/core/lib/index.js:76:24)
at async Auth (webpack-internal:///(rsc)/../../node_modules/@auth/core/index.js:130:34)
at async /app/node_modules/next/dist/compiled/next-server/app-route.runtime.dev.js:6:55778
at async eO.execute (/app/node_modules/next/dist/compiled/next-server/app-route.runtime.dev.js:6:46527)
at async eO.handle (/app/node_modules/next/dist/compiled/next-server/app-route.runtime.dev.js:6:57112)
at async doRender (/app/node_modules/next/dist/server/base-server.js:1352:42)
at async cacheEntry.responseCache.get.routeKind (/app/node_modules/next/dist/server/base-server.js:1562:40)
at async DevServer.renderToResponseWithComponentsImpl (/app/node_modules/next/dist/server/base-server.js:1482:28)
at async DevServer.renderPageComponent (/app/node_modules/next/dist/server/base-server.js:1908:24)
at async DevServer.renderToResponseImpl (/app/node_modules/next/dist/server/base-server.js:1946:32)
at async DevServer.pipeImpl (/app/node_modules/next/dist/server/base-server.js:921:25)
at async NextNodeServer.handleCatchallRenderRequest (/app/node_modules/next/dist/server/next-server.js:272:17)
at async DevServer.handleRequestImpl (/app/node_modules/next/dist/server/base-server.js:817:17)
at async /app/node_modules/next/dist/server/dev/next-dev-server.js:339:20
at async Span.traceAsyncFn (/app/node_modules/next/dist/trace/trace.js:154:20)
at async DevServer.handleRequest (/app/node_modules/next/dist/server/dev/next-dev-server.js:336:24)
at async invokeRender (/app/node_modules/next/dist/server/lib/router-server.js:173:21)
at async handleRequest (/app/node_modules/next/dist/server/lib/router-server.js:350:24)
at async requestHandlerImpl (/app/node_modules/next/dist/server/lib/router-server.js:374:13)
at async Server.requestListener (/app/node_modules/next/dist/server/lib/start-server.js:141:13)
My repo is a Nx monorepo setup, code located under apps/portal-ui, hence its running the server.js in the path of apps/portal-ui.
//@ts-check// eslint-disable-next-line @typescript-eslint/no-var-requiresconst{ composePlugins, withNx }=require('@nx/next');constcreateNextIntlPlugin=require('next-intl/plugin');constwithNextIntl=createNextIntlPlugin();/** type {import('next').NextConfig} *//** * @type {import('@nx/next/plugins/with-nx').WithNxOptions} **/constnextConfig={cleanDistDir: true,nx: {// Set this to true if you would like to use SVGR// See: https://github.com/gregberge/svgrsvgr: false,},output: 'standalone',};constplugins=[//withNx was blocking the Jest exit for some reason, disable it when NODE_ENV == 'test'
...(process.env.NODE_ENV=='test' ? [] : [withNx]),withNextIntl,// Add more Next.js plugins to this list if needed.];module.exports=composePlugins(...plugins)(nextConfig);
The CI process run next build first then run the docker build with following dockerfile. It just copy the standalone output into the image.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am getting this error when running inside docker in my local machine. The same standalone production build run in my machine directly is working perfectly. I have checked the following issues but none of this help.
Error detail
standalone build trace:
next dev
run inside docker container trace:Version info:
env.local used by docker and local
I have tried setting
AUTH_URL=http://localhost:3300/api/auth
but it doesnt workauth.ts
next.config.js and Dockerfile
apps/portal-ui
, hence its running the server.js in the path ofapps/portal-ui
.next build
first then run the docker build with following dockerfile. It just copy the standalone output into the image.Beta Was this translation helpful? Give feedback.
All reactions