unjs / jiti

Runtime Typescript and ESM support for Node.js
MIT License
1.49k stars 52 forks source link

DeprecationWarning: fs.Stats constructor is deprecated. #248

Closed 42Willow closed 3 weeks ago

42Willow commented 3 weeks ago

Environment

Node.js version: v22.2.0

$ npm ls jiti
schooltape@3.0.0-beta /home/willow/documents/github/st/schooltape
├── jiti@1.21.6
├─┬ tailwindcss@3.4.4
│ └── jiti@1.21.0
└─┬ wxt@0.18.4
  ├─┬ c12@1.10.0
  │ └── jiti@1.21.0
  └── jiti@1.21.0

Reproduction

https://github.com/schooltape/schooltape/tree/feat/wxt-storage

bun run dev

~/documents/github/st/schooltape> node --trace-deprecation ./node_modules/.bin/wxt -b firefox                                                                         11/06/24 15:31:10

WXT 0.18.3                                                                                                                                                                 3:31:18 pm
(node:60369) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
    at tryStatSync (/home/willow/documents/github/st/schooltape/node_modules/c12/node_modules/jiti/dist/jiti.js:1:229054)
    at /home/willow/documents/github/st/schooltape/node_modules/c12/node_modules/jiti/dist/jiti.js:1:243587
    at moduleResolve (/home/willow/documents/github/st/schooltape/node_modules/c12/node_modules/jiti/dist/jiti.js:1:244278)
    at _tryModuleResolve (/home/willow/documents/github/st/schooltape/node_modules/c12/node_modules/jiti/dist/jiti.js:1:244853)
    at _resolve (/home/willow/documents/github/st/schooltape/node_modules/c12/node_modules/jiti/dist/jiti.js:1:245952)
    at resolveSync (/home/willow/documents/github/st/schooltape/node_modules/c12/node_modules/jiti/dist/jiti.js:1:246575)
    at resolvePathSync (/home/willow/documents/github/st/schooltape/node_modules/c12/node_modules/jiti/dist/jiti.js:1:246654)
    at Function._resolve [as resolve] (/home/willow/documents/github/st/schooltape/node_modules/c12/node_modules/jiti/dist/jiti.js:1:251002)
    at tryResolve (file:///home/willow/documents/github/st/schooltape/node_modules/c12/dist/index.mjs:300:27)
    at resolveConfig (file:///home/willow/documents/github/st/schooltape/node_modules/c12/dist/index.mjs:320:20)

Describe the bug

A deprecation warning for fs.Stats constructor image

Additional context

No response

Logs

No response

pi0 commented 3 weeks ago

Hi. Please either renew lockfile or add/force jiti to latest 1.21.6 and issue should be resolved.

42Willow commented 3 weeks ago

Ok, will do, thanks!