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

Cannot find module while using electron-remote #46

Closed
walleXD opened this issue Oct 23, 2017 · 1 comment
Closed

Cannot find module while using electron-remote #46

walleXD opened this issue Oct 23, 2017 · 1 comment

Comments

@walleXD
Copy link

walleXD commented Oct 23, 2017

Hey all,

I am trying to use electron-remote where it spins out a hidden browser window to run functions in the background. So, the approach is:

import { requireTaskPool } from 'electron-remote';

const myCoolModule = requireTaskPool(require.resolve('./my-cool-module'))

But, using electron-webpack, electron complains Uncaught Error: Cannot find module. Is there a way to make sure the import works?

My guess is that this is happening because electron-remote is trying to handle the module directly, like it would in a traditional context while our imports are being handled by Webpack.

Thanks for all the help @develar and the awesome package!

@walleXD
Copy link
Author

walleXD commented Oct 23, 2017

This seems to be specific to electron-remote & how it handles filepaths. It seems it's approach doesn't work with Webpack. I am closing the issue as it's not electron-webpack specific.

But @develar any ideas about work arounds for this kind of situation?

@walleXD walleXD closed this as completed Oct 23, 2017
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

1 participant