I\'m getting a \'fs.readFileSync is not a function\' in Chrome debugger after trying to call readFileSync();
I call it...
const fs = require(\'fs\')
I'm getting a 'fs.readFileSync is not a function' in Chrome debugger after trying to call readFileSync();
fs
will not work in the browser. This is by design as to protect your filesystem from potential security threats.
If you need access to this in a browser environment, consider making use of Electron which allows you to make use of OS level NodeJS packages in a running instance of Chromium.