deno icon indicating copy to clipboard operation
deno copied to clipboard

`fs.statSync` return value is not instance of `fs.Stats`

Open littledivy opened this issue 1 year ago • 0 comments
trafficstars

Reproduction from Next.js on Windows:

import etag from "npm:etag";
import {statSync, Stats} from "node:fs";

const stat = statSync("README.md");
etag(stat);
error: Uncaught (in promise) TypeError: argument entity must be string, Buffer, or fs.Stats
    at etag (file:///Users/divy/Library/Caches/deno/npm/registry.npmjs.org/etag/1.8.1/index.js:83:11)
    at file:///Users/divy/gh/deno/etag.mjs:5:1

Simpler reproduction:

import {statSync, Stats} from "node:fs";

const stat = statSync("README.md");
console.log(stat instanceof Stats); // false

littledivy avatar Feb 06 '24 11:02 littledivy