Open lonewolf73 opened 1 month ago
I think this is not the right library for your use case. Based on the other libraries/tools you mentioned (react
& vite
), I guess you are working on a Web application. This library is for Node.js backend applications. If you want to read local files from your Web application, the File System API would be the right starting point.
hello everyone !!
I am implementing a very simple react vite, actually at versions
react@18.3.1
andvite@5.4.0
. Calling file-fetch to read a local text file like :caling as represented in when I compile with
npm run build
I get this error :node_modules/file-fetch/lib/get.js (2:9): "stat" is not exported by "__vite-browser-external", imported by "node_modules/file-fetch/lib/get.js".
looking at that file I see that import is called by:
import { stat } from 'node:fs/promises'
where that "stat" comes from referenced promises in the file
promises.d.ts
as like as :and that stat funcion is called as like as :
and looking at that stat call I see there are
5 overloads
of thePromise<Stats>
.... does that error , as mentioned earlier, maybe related to those 5 overloads so it doesn't just match the right function to call? or maybe some related-dependencies? Or eventually what does mean that kind of error:...not exported by "__vite-browser-external", imported by...
?Thanks in advance! Cheers!