0

This issue is only specific to fs-extra module. When i try to load browserified bundle.js in html, the error shows up.

bundle.js:2483 Uncaught TypeError: Object prototype may only be an Object or null: undefined
    at Function.setPrototypeOf (<anonymous>)
    at bundle.js:2483
    at patch (bundle.js:2485)
    at patch (bundle.js:1949)
    at Object.<anonymous> (bundle.js:1941)
    at Object.<anonymous> (bundle.js:2220)
    at Object.31../clone.js (bundle.js:2220)
    at o (bundle.js:1)
    at bundle.js:1
    at Object.14../copy (bundle.js:803)
Jayanth R
  • 11
  • 1
  • You try to load the `fs-extra` module in the browser? That won't work, because the browser does not have access to the filesystem ... – derpirscher Feb 27 '21 at 11:53
  • I'm running expressJS application which serves index.html page. In the view i need to perform few operations related to files using fs-extra. – Jayanth R Feb 27 '21 at 17:12
  • Still, you have a html file which is displayed in the browser and loads your bundle.js, right? That won't work. If you need some filesystem operations, you must separate the code which runs on the server from the code which runs in the client. You must not have references to `fs-extra` module on the client side ... – derpirscher Feb 27 '21 at 17:18

0 Answers0