我将
nuxt 3.8.2
与 @auth/core 0.20.0
一起使用,并在访问提供商(keycloak)登录页面时在 yarn build && node .output/server/index.mjs
之后遇到此问题...
[auth][error] TypeError: fetch failed
at Object.fetch (node:internal/deps/undici/undici:11730:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
这是我的package.json ...
{
"name": "next-auth-nuxt",
"private": true,
"scripts": {
"dev": "nuxt prepare && nuxt dev",
"build": "nuxt build",
"generate": "nuxt generate",
"preview": "nuxt preview"
},
"devDependencies": {
"@nuxt/eslint-config": "^0.1.1",
"eslint": "^8.29.0",
"h3": "1.9.0",
"nuxt": "3.8.2"
},
"dependencies": {
"@auth/core": "^0.20.0",
"@hattip/adapter-node": "^0.0.35",
"@vueform/nuxt": "^1.4.0",
"@vueform/vueform": "^1.6.5",
"ag-grid-community": "^31.0.1",
"ag-grid-vue3": "^31.0.1",
"moment": "^2.30.1",
"sweetalert2": "^11.10.2"
}
}
非常感谢任何帮助。
它在开发模式下的本地主机上运行良好。仅发生在构建模式下。