leo / electron-next

Build Electron apps using Next.js
https://github.com/leo/site/blob/beef3a7dc1dfd435a9d8377e3b1b59761ccb7fc7/pages/2017/electron-next.js
MIT License
548 stars 41 forks source link

Error: "Can't resolve 'fs'" #2

Closed trevordmiller closed 7 years ago

trevordmiller commented 7 years ago

I'm getting this error when using https://github.com/leo/electron-next-skeleton

image

Should the skeleton next.config.js have a target of electron-renderer?

Here is my repo: https://github.com/trevordmiller/hideaway. Can be reproduced by cloning and running npm install && npm run dev.

trevordmiller commented 7 years ago

Looks like that is what is being done in now-desktop: https://github.com/zeit/now-desktop/blob/master/renderer/next.config.js#L3. I made the change and it is working: https://github.com/trevordmiller/hideaway/commit/979b91544380c27d02caa59222c548a66abd84cd. Would be helpful to update https://github.com/leo/electron-next-skeleton to work out of the box; I tried to put this issue there but that repo doesn't allow issues.

riddla commented 6 years ago

@trevordmiller: I hit this error, too. Do you think it would make (more) sense to update https://github.com/zeit/next.js/blob/master/examples/with-electron/renderer/next.config.js?