"The Fetch API is an experimental feature. This feature could change at any time" while installing a Nuxt3 app
Asked Answered
A

4

14

I try to creat new nuxt app using fallowing command

npx nuxi init my-app

successfully creating new app with Nuxt 3.0 stable inside but i get this annoying response

Nuxi 3.0.0-rc.10                                                                                              15:04:22

 ERROR  (node:35527) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)

What confuses me is the version of Nuxi 3.0.0-rc.10 and the Error I belive it comes from node.

node - 18.12.1

npm - 8.19.2

git - 2.38.1

Archlute answered 4/12, 2022 at 14:21 Comment(0)
L
22

It was enough for me to upgrade to node 18.13.0

Lujan answered 24/1, 2023 at 12:38 Comment(4)
I'm deploying to Vercel, which only seems to support up to 18.12.1 currently. I'm not sure what you mean by "You can also try --no-experimental-fetch flag." It seems like it would do the opposite of what I want. nodejs.org/en/blog/announcements/v18-release-announce/… – Friedrich
+1 what Ryan said "It's possible to disable the API by supplying the --no-experimental-fetch command-line flag." - that would stop you fetch()ing, rather than disable the warning. – Sibley
Vercel should provide minor and patch versions. At least that's what they claim in docs. You can read more here vercel.com/docs/concepts/functions/serverless-functions/… You could try adding this to package.json: {"engines": { "node": ">=18.13.0" }} – Lujan
Now node 20 is out and about to enter LTS next month πŸŽ‰ This definitely helped remove the error though πŸš€ – Cutcliffe
I
3

First off, you should be running Nuxt 3.0.0 (stable version), not the RC.

Also, this is a warning hence something that you can omit. Especially because it is tied to Node v18 itself and not Vue/Nuxt. Some details on how to suppress the warning are available here: https://github.com/netlify/cli/issues/4608#issuecomment-1223696635

As for the warning, it is a common thing to have experimental features marked until they are fully stable. Here is the official source for that one.

Ilonailonka answered 4/12, 2022 at 14:31 Comment(4)
How to run Nuxt 3.0.0 ( stable version ) and not RC ? I just open a terminal and run the command after that I get the response. Do I need to upgrade Nuxi ? I did this from other PC and do not get the warning and Nuxi was 3.0.0 – Archlute
@martcube not sure why nuxi is not fetching the latest version in your case. If you have it installed, please give it an upgrade. Otherwise, if you don't have it installed and are fetching it remotely (with npx), it should be good. Otherwise, you can also manually set "nuxt": "3.0.0" in your package.json > devDependencies. Still, the issue is not related to Nuxt as explained. – Ilonailonka
even tho is showing to me that is running Nuxi-rc-10 it still installs Nuxt3.0.0. That is strange to me. Maybe I have some wrong configuration in my PC I just cant trace it. – Archlute
Now sure where you can see that it installs 3.0.0, but the info displayed when you launch your dev server is still the one to believe. Again, unrelated to the warning. – Ilonailonka
S
1

I'm working on an app using next.js and I'm also getting this error:

ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time

I was using node version 18.0.0

Switching to node version 19.8.1 fixed it for me.

Syntactics answered 29/8, 2023 at 18:46 Comment(1)
You should avoid odd versions of Node since they will never be LTS nodejs.dev/en/about/releases mode can be found here. At this time though the latest version on 18 does not have this message and 20 is available and about to enter LTS next month. – Cutcliffe
B
-1

I helped upgrade the version node v18.12.1 -> v19.4.0

Bittern answered 13/1, 2023 at 19:26 Comment(2)
I don't recommend using a non LTS version. – Ilonailonka
You should avoid odd versions of Node since they will never be LTS nodejs.dev/en/about/releases mode can be found here. At this time though the latest version on 18 does not have this message and 20 is available and about to enter LTS next month. – Cutcliffe

© 2022 - 2024 β€” McMap. All rights reserved.