Winston 3.2 Uncaught TypeError: fs.existsSync is not a function
See original GitHub issue- _
winston
version 3.2 - _Operating System? macOS
- Node JS, React framework
What is the problem?
winstonLogger.Log() fails with the exception:
Uncaught TypeError: fs.existsSync is not a function at File._createLogDirIfNotExist (file.js:804) at new File (file.js:132) at Object. (mylogger.js:16) at webpack_require (bootstrap 284d16fcfe1dcfa44176:676) at fn (bootstrap 284d16fcfe1dcfa44176:87) at Object. (mymodule.js:5) at webpack_require (bootstrap 284d16fcfe1dcfa44176:676) at fn (bootstrap 284d16fcfe1dcfa44176:87) at Object. (app.js:21) at webpack_require (bootstrap 284d16fcfe1dcfa44176:676)
What do you expect to happen instead?
I expect the .log() function to log to a file transport
Other information
Issue Analytics
- State:
- Created 4 years ago
- Reactions:8
- Comments:12 (1 by maintainers)
Top Results From Across the Web
TypeError: fs.existsSync is not a function - Stack Overflow
fs is a nodejs library so you can't use it on browser side. Use winston-transport-browserconsole instead.
Read more >How To Resolve Fs.Existssync Is Not A Function - ADocLib
existsSync method is used to synchronously check if a file already exists in the given path or not. It returns a fs.existsSync method....
Read more >TypeError: fs.existsSync is not a function - DEV Community
While using Sass in a react project and using useRef hook, one might come across this error: React and Sass error.
Read more >How to solve: TypeError: fs.existsSync is not a function - Reddit
TypeError : fs.existsSync is not a functionhasBinarynode_modules/node-sass/lib/extensions.js:405 402 | */ 403 | 404 | function ...
Read more >Please am getting an error on my react electron app "TypeError
Please am getting an error on my react electron app "TypeError: fs.existsSync is not a function" below are my codes.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am experiencing similar logs with Webpack 4. It breaks my React app entirely.
Is there any solution for this TypeError: fs.existsSync is not a function error? what is the default file location ?