Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR (node:52837) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated #405

Closed
pochat opened this issue Apr 27, 2024 · 15 comments
Labels

Comments

@pochat
Copy link

pochat commented Apr 27, 2024

Environment

  • Operating System: Darwin
  • Node Version: v22.0.0
  • Nuxt Version: 3.11.2
  • CLI Version: 3.11.1
  • Nitro Version: 2.9.6
  • Package Manager: npm@10.6.0
  • Builder: -
  • User Config: devtools
  • Runtime Modules: -
  • Build Modules: -

Reproduction

-Install latest node
-Install latest nuxt
-npm run dev

Describe the bug

When upgrading to the latest node and the lastest nuxt version, the following error repeatedly appears in the console:
ERROR (node:52865) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated

The error is present at every npm run dev, and npm run build.

Additional context

No response

Logs

No response

@Infectious-Smile
Copy link

+1

@xiao-xiaozi
Copy link

use node version v19.2.0 can clear this error info

@RobinTail
Copy link

Odd versions of Node are not for production use, @xiao-xiaozi .
Use 20.x instead of 19, it's LTS now, and there should not be that deprecation warning.
https://github.com/nodejs/Release

@RobinTail
Copy link

ERROR (node:52865) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated

Why deprecation warning causes the error in nuxt?
Is there some configuration for that, @pochat ?

@ExEr7um
Copy link

ExEr7um commented Apr 30, 2024

ERROR (node:52865) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated

Why deprecation warning causes the error in nuxt?

Is there some configuration for that, @pochat ?

I don't think it causes any errors, just a simple warning.

@manniL
Copy link
Member

manniL commented Apr 30, 2024

For now, this is just a warning and can be ignored. ☺️

@danielroe danielroe transferred this issue from nuxt/nuxt Apr 30, 2024
@danielroe
Copy link
Member

This is an upstream issue (wooorm/import-meta-resolve#27) which is resolved in v4.1.0 of import-meta-resolve, but because nuxi inlines mlly, and mlly inline import-meta-resolve, it may take a little while for the fix to percolate downward into Nuxt.

cc: @pi0

@pi0
Copy link
Member

pi0 commented May 1, 2024

wroking on mlly release expect it shortly :)

@igalklebanov
Copy link

@pi0 thank you! 💪

can we get a bump @ https://github.com/unjs/pkg-types ? still uses 1.6.1.

@manniL
Copy link
Member

manniL commented May 4, 2024

@pi0 thank you! 💪

can we get a bump @ unjs/pkg-types ? still uses 1.6.1.

refreshing the lockfile should be enough as it uses the ^1.6.1 constraint

@HummingMind
Copy link

@danielroe @manniL

So, is this going to be fixed in CLI v3.12.0 tomorrow? Sounds like mlly was updated to use the latest version of import-meta-resolve, which has the fix for this.

Thank you for all your hard work!

@pochat
Copy link
Author

pochat commented Jun 12, 2024

Hi @danielroe,

I hope you are well, and thank you for the update.

I still see the error in my console. Do we need to update to the latest Nuxt version?

Thank you.

image

@danielroe
Copy link
Member

Yes, mlly is used in Nuxt as well so you need to update more than just nuxi.

@scshasha
Copy link

use node version v19.2.0 can clear this error info

This worked for me. Thanks @pi0

@Chambo015
Copy link

install nvm and use 20.15.1 version node

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests