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

import the module from the main process throw exception on first run #29

Closed
pmoleri opened this issue Nov 30, 2016 · 0 comments
Closed

Comments

@pmoleri
Copy link

pmoleri commented Nov 30, 2016

Steps:

  • Remove %APPDATA%\Electron
  • From the main process:
    import installExtension, { REACT_DEVELOPER_TOOLS } from 'electron-devtools-installer';
  • Run
App threw an error during load
Error: ENOENT: no such file or directory, mkdir 'C:\Users\<user>\AppData\Roaming\Electron\extensions'
    at Error (native)
    at fs.mkdirSync (fs.js:922:18)
    at Object.fs.mkdirSync (ELECTRON_ASAR.js:675:16)
    at getPath (C:\Work\UXTools-git\indigo-electron\node_modules\electron-devtools-installer\dist\utils.js:26:18)
    at Object.<anonymous> (C:\Work\UXTools-git\indigo-electron\node_modules\electron-devtools-installer\dist\index.js:42:59)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)

It seems that some code is being run at import this could be solved executing that code lazily when needed.

Vlemert pushed a commit to Vlemert/electron-devtools-installer that referenced this issue Jan 10, 2017
The mkdir in getPath gets executed on import whenever this library is used. This causes an error to be thrown when the electron app that uses it is freshly installed, and the electron userData directory is not yet created.

This change moves the mkdir call to the first place the existence of the extensionsStore is actually required.

Fixes MarshallOfSound#29
MarshallOfSound pushed a commit that referenced this issue Jan 11, 2017
The mkdir in getPath gets executed on import whenever this library is used. This causes an error to be thrown when the electron app that uses it is freshly installed, and the electron userData directory is not yet created.

This change moves the mkdir call to the first place the existence of the extensionsStore is actually required.

Fixes #29
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