我从Nextjs 12升级到13,但现在每次我运行应用程序时,我都会将ECONNREFUSED发送到本地,但端口一直在变化。它不会渲染
> dtpms-usrmgmt-ui@0.1.20 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)
1条答案
按热度按时间watbbzwu1#
你在用nextjs新的google字体功能吗?我的意思是通过从
'next/font/google'
导入来使用字体?我刚刚在一个新的nextjs项目中遇到了类似的问题,该项目初始化为
npx create-next-app@latest
。默认情况下,layout.tsx
使用此新功能:import { Inter } from 'next/font/google'.
const inter = Inter({ subsets: ['latin'] })
我把它注解掉了,错误消失了。我猜nextjs试图访问google服务器来检索字体,但失败了。