I upgraded from Nextjs 12 to 13 but now everytime I run the application, I'm getting ECONNREFUSED to my local but the port keeps changing. and it won't render
> [email protected] dev /run/media/rud31mp/drive2/Codes/typescript/dtpms/dtpms-usrmngr-ui
> next dev -p 3002
- ready started server on 0.0.0.0:3002, url: http://localhost:3002
- info Loaded env from /run/media/rud31mp/drive2/Codes/typescript/dtpms/dtpms-usrmngr-ui/.env.local
- warn Invalid next.config.js options detected:
- warn The root value has an unexpected property, externals, which is not in the list of allowed properties (amp, analyticsId, assetPrefix, basePath, cleanDistDir, compiler, compress, configOrigin, crossOrigin, devIndicators, distDir, env, eslint, excludeDefaultMomentLocales, experimental, exportPathMap, generateBuildId, generateEtags, headers, httpAgentOptions, i18n, images, modularizeImports, onDemandEntries, optimizeFonts, output, outputFileTracing, pageExtensions, poweredByHeader, productionBrowserSourceMaps, publicRuntimeConfig, reactStrictMode, redirects, rewrites, sassOptions, serverRuntimeConfig, skipMiddlewareUrlNormalize, skipTrailingSlashRedirect, staticPageGenerationTimeout, swcMinify, target, trailingSlash, transpilePackages, typescript, useFileSystemPublicRoutes, webpack).
- warn See more info here: https://nextjs.org/docs/messages/invalid-next-config
- event compiled client and server successfully in 1216 ms (311 modules)
- wait compiling...
- event compiled client and server successfully in 334 ms (311 modules)
- wait compiling /not-found (client and server)...
- event compiled client and server successfully in 694 ms (555 modules)
- warn Fast Refresh had to perform a full reload due to a runtime error.
- error Error: connect ECONNREFUSED 127.0.0.1:33241
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1487:16)
at TCPConnectWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
errno: -111,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 33241
}
- wait compiling /_error (client and server)...
- event compiled client and server successfully in 385 ms (556 modules)

This might be related to node > v16. Try downgrading it to v16.
I know this answer isn't ideal, but it seams to be a race condition between the webpack dev environment and the request to launch the environment itself.
I'm still investigating it. Keep an eye on this issue
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With