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

Error in distribution: Cannot find module 'electron-reload' #17

Open
mcpride opened this issue Mar 21, 2017 · 3 comments
Open

Error in distribution: Cannot find module 'electron-reload' #17

mcpride opened this issue Mar 21, 2017 · 3 comments

Comments

@mcpride
Copy link

mcpride commented Mar 21, 2017

At first: currently i try to learn building electron apps by example. Thank you for your work, it's a great help. The configuration of this project is excellent - debugging and packaging for distribution works fine.

But if I call the distributed electron app on my WIN10 x64 machine then following error occurs:

Uncaught Exception:
Error: Cannot find module 'electron-reload'
    at Module._resolveFilename (module.js:470:15)
    at Function.Module._resolveFilename (C:\Tests\Aurelia\aurelia-cli-electron-app\dist\win-unpacked\resources\electron.asar\common\reset-search-paths.js:35:12)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\Tests\Aurelia\aurelia-cli-electron-app\dist\win-unpacked\resources\app.asar\index.js:5:1)
    at Object.<anonymous> (C:\Tests\Aurelia\aurelia-cli-electron-app\dist\win-unpacked\resources\app.asar\index.js:31:3)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)

I'm a beginner in this field - so I have no idea how to fix this. Could you help me, please?

@MeirionHughes
Copy link
Owner

MeirionHughes commented Mar 21, 2017

I'd not actually had a chance to use the dist yet (it was PR'ed by a contributor).

I guess you could remove this line: https://github.com/MeirionHughes/aurelia-cli-electron-app/blob/master/index.js#L5

its only supposed to be there during development so it auto-reloads for you when you change source files.

@mcpride
Copy link
Author

mcpride commented Mar 21, 2017

Thanx for your hint, commenting out the related require entry in index.js works but then the auto-reload function is disabled.

@ChauVV
Copy link

ChauVV commented Dec 4, 2017

you should check if dev mode:
if (process.env.NODE_ENV === 'development') { require('electron-reload')(__dirname) }

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