Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use with Next.js #30

Closed
saeta-eth opened this issue Apr 25, 2020 · 4 comments
Closed

Can't use with Next.js #30

saeta-eth opened this issue Apr 25, 2020 · 4 comments

Comments

@saeta-eth
Copy link

saeta-eth commented Apr 25, 2020

Hi.

I can't use this library with Next.js. I see this error:

Module not found: Can't resolve 'fs' in '.../node_modules/electron'

Is there any workaround?
Thanks!

@sindresorhus
Copy link
Owner

That is a problem with Next.js. You should open an issue there instead.

@lacymorrow
Copy link
Contributor

@slorenzo that's usually an issue with trying to server-side render native modules. Make sure your code is being run only in the "Main" process.

@saeta-eth
Copy link
Author

saeta-eth commented May 3, 2020

Thanks @lacymorrow. I found out a workaround here. But another error appears, so I decided not to use this package in the renderer process.

@lacymorrow
Copy link
Contributor

No problem @slorenzo. If you're looking for a solution to build Electron with a statically-rendered React + Next.js app I can suggest Nextron.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants