Nuxt3 : [nuxt] [request error] [unhandled] [500] fetch failed (http://localhost:3000/__nuxt_vite_node__/manifest)

huangapple go评论63阅读模式
英文:

Nuxt3 : [nuxt] [request error] [unhandled] [500] fetch failed (http://localhost:3000/__nuxt_vite_node__/manifest)

问题

这个错误的意思是什么?
我没有对我的代码做任何更改。当我构建我的应用程序时,它可以正常工作,但在开发模式下,它显示这个错误:npm run dev

我尝试重新构建应用程序,删除了所有node_modules,并安装和更新了依赖项。

这是错误堆栈跟踪:

在异步 $fetchRaw2 (/D:/IAICB-70/inteliaiclipboard/node_modules/ofetch/dist/shared/ofetch.502a4799.mjs:180:24)
在异步 /D:/IAICB-70/inteliaiclipboard/.nuxt/dev/index.mjs:745:20
在异步 /D:/IAICB-70/inteliaiclipboard/.nuxt/dev/index.mjs:826:64
在异步 /D:/IAICB-70/inteliaiclipboard/.nuxt/dev/index.mjs:378:22
在异步 Object.handler (/D:/IAICB-70/inteliaiclipboard/node_modules/h3/dist/index.mjs:1196:19)
在异步 toNodeHandle (/D:/IAICB-70/inteliaiclipboard/node_modules/h3/dist/index.mjs:1271:7)
在异步 Object.ufetch [as localFetch] (/D:/IAICB-70/inteliaiclipboard/node_modules/unenv/runtime/fetch/index.mjs:9:17)
在异步 Object.errorhandler [as onError] (/D:/IAICB-70/inteliaiclipboard/.nuxt/dev/index.mjs:462:30)
在异步 Server.toNodeHandle (/D:/IAICB-70/inteliaiclipboard/node_modules/h3/dist/index.mjs:1278:9)
英文:

What does this error mean?
Nuxt3 : [nuxt] [request error] [unhandled] [500] fetch failed (http://localhost:3000/__nuxt_vite_node__/manifest)

I have done no changes to my Code. When I build my app it works but on dev, it show me this error: npm run dev

I tried to rebuild the app, deleted all node_modules, and installed and updated the dependencies.

here is the stracktrace:

at async $fetchRaw2 (/D:/IAICB-70/inteliaiclipboard/node_modules/ofetch/dist/shared/ofetch.502a4799.mjs:180:24)
at async /D:/IAICB-70/inteliaiclipboard/.nuxt/dev/index.mjs:745:20
at async /D:/IAICB-70/inteliaiclipboard/.nuxt/dev/index.mjs:826:64
at async /D:/IAICB-70/inteliaiclipboard/.nuxt/dev/index.mjs:378:22
at async Object.handler (/D:/IAICB-70/inteliaiclipboard/node_modules/h3/dist/index.mjs:1196:19)
at async toNodeHandle (/D:/IAICB-70/inteliaiclipboard/node_modules/h3/dist/index.mjs:1271:7)
at async Object.ufetch [as localFetch] (/D:/IAICB-70/inteliaiclipboard/node_modules/unenv/runtime/fetch/index.mjs:9:17)
at async Object.errorhandler [as onError] (/D:/IAICB-70/inteliaiclipboard/.nuxt/dev/index.mjs:462:30)
at async Server.toNodeHandle (/D:/IAICB-70/inteliaiclipboard/node_modules/h3/dist/index.mjs:1278:9)

答案1

得分: 3

使用 Node.js v18,你应该像下面这样更新你的开发脚本在 package.json 文件中:

"dev": "nuxt dev --host 0.0.0.0"

如果问题仍然存在:

"dev": "nuxt dev --host 0.0.0.0 --https --ssl-cert localhost.pem --ssl-key localhost-key.pem"

如果你在使用 Docker,添加以下行到你的 Docker 文件中:

ENV HOST=0.0.0.0

这很可能是一个 SSL 问题或者与 Node.js v18 有关,之前在 v16 版本下是正常工作的。

英文:

using node v18 you should update your dev script in package.json file like below :

"dev": "nuxt dev --host 0.0.0.0"

If the issue still occures :

"dev": "nuxt dev --host 0.0.0.0 --https --ssl-cert localhost.pem --ssl-key localhost-key.pem"

If you are using docker add this line to your docker file :

ENV HOST=0.0.0.0

It is likely an SSL issue or something with node v18<br>
This was working fine with v16

答案2

得分: 0

这是你要求的代码部分的翻译:

I just got this working.
I used this page on [storyblok][1]

This is what I have in scripts:

    &quot;proxy&quot;: &quot;mkcert -install &amp;&amp; mkcert localhost &amp;&amp; local-ssl-proxy --source 3010 --target 3000 --cert localhost.pem --key localhost-key.pem&quot;,
    &quot;dev&quot;: &quot;nuxt dev&quot;,

I ran the proxy first with `npm run proxy` and ran a second terminal where I ran

    npm run dev

My project was served on https://localhost:3010/

[1]: https://www.storyblok.com/faq/setup-dev-server-https-windows

如果你需要其他帮助,请随时提出。

英文:

I just got this working.
I used this page on storyblok

This is what I have in scripts:

&quot;proxy&quot;: &quot;mkcert -install &amp;&amp; mkcert localhost &amp;&amp; local-ssl-proxy --source 3010 --target 3000 --cert localhost.pem --key localhost-key.pem&quot;,
&quot;dev&quot;: &quot;nuxt dev&quot;,

I ran the proxy first with npm run proxy and ran a second terminal where I ran

npm run dev

My project was served on https://localhost:3010/

huangapple
  • 本文由 发表于 2023年3月9日 14:02:41
  • 转载请务必保留本文链接:https://go.coder-hub.com/75680934.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定