Closed neiljmac closed 6 months ago
Looks like you're using next.js to compile for the browser; and so it's failing to resolve the node core module fs
, since that isn't available in a browser environment.
Thanks @RyanZim. I need to go away and learn more then. I'm rather new to next.js This can be closed.
fs-extra
version: ^11.2.0On running
npm run dev
when I open the applciaiton in my browser, the message below is emitted:I am using Typescript and am importing using this:
import * as fse from 'fs-extra';
I implement using this, for example:
await fse.writeFile(filePath, JSON.stringify(response.data, null, 2));
Why can it not resolve 'fs' as it is clearly in the module dir structure?