Electron start error

browser-app mode works well.
But electron mode doesn’t work well. (extension/other code is same when i running browser-app)
It’s error message when i start “yarn run start” on electron-app.

my@my:~/git_repo/theia_yo_extension/electron-app$ yarn run start
yarn run v1.15.2
$ theia start
WARNING: /home/my/git_repo/theia_yo_extension/electron-app/package.json does not have a “main” entry.
Please add the following line:
“main”: “src-gen/frontend/electron-main.js”
/home/my/git_repo/theia_yo_extension/node_modules/bindings/bindings.js:121
throw e;
^

Error: Module did not self-register: ‘/home/my/git_repo/theia_yo_extension/node_modules/drivelist/build/Release/drivelist.node’.
at process.func [as dlopen] (electron/js2c/asar.js:140:31)
at Object.Module._extensions…node (internal/modules/cjs/loader.js:1034:18)
at Object.func [as .node] (electron/js2c/asar.js:140:31)
at Module.load (internal/modules/cjs/loader.js:815:32)
at Module._load (internal/modules/cjs/loader.js:727:14)
at Function.Module._load (electron/js2c/asar.js:769:28)
at Module.require (internal/modules/cjs/loader.js:852:19)
at require (internal/modules/cjs/helpers.js:74:18)
at bindings (/home/my/git_repo/theia_yo_extension/node_modules/bindings/bindings.js:112:48)
at Object. (/home/my/git_repo/theia_yo_extension/node_modules/drivelist/js/index.js:25:27)

How can i do to resolve it ?
Any ideas can help me.
Thanks for read my issue.

Did you run rebuild:electron?

Also here.

Same problem here. rebuild:electron indicates that modules are already built for electron.
Any hints? I tried deleting/reinstalling node modules, rebuilding node dependencies, installing this module (drivelist) especifically… but no way.

The rebuild is broken in general if you switch branches, I hit this problem all the time. Run yarn rebuild:browser && yarn rebuild:electron, it should help.

1 Like

Great, it worked, thanks!
Actually the trick was first rebuild for browser then rebuild again for electron. The drivelist module was then re-processed, and finally worked. I was stubbornly going only for the electron way… doh!

Thanks for the hint @kittaakos!

@kittaakos I am still getting this error with
Theia v1.19.0
Windows OS 10

 electron-app: + twxs.cmake: downloaded successfully
electron-app: --- collecting extension-packs ---
electron-app: --- collecting extension dependencies ---
lerna success run Ran npm script 'download:plugins' in packages:
lerna success - electron-app
Done in 11.59s.
yarn run v1.22.15
$ cd .. && husky install theia-ide/.husky
husky - Git hooks installed
Done in 0.52s.
Done in 191.25s.

achakrab@CHAKRAB30 MINGW64 /c/theia/tool-suite/theia-ide (theia-update)
$ yarn rebuild:browser
yarn run v1.22.15
$ theia rebuild:browser
native node modules are already rebuilt for browser
Done in 1.67s.

achakrab@CHAKRAB30 MINGW64 /c/theia/tool-suite/theia-ide (theia-update)
$ yarn rebuild:electron
yarn run v1.22.15
$ theia rebuild:electron
Module not found: find-git-repositories
Processed "native-keymap"
Processed "drivelist"
Processed "@theia/node-pty"
Processed "nsfw"
√ Rebuild Complete
Done in 7.11s.

achakrab@CHAKRAB30 MINGW64 /c/theia/tool-suite/theia-ide (theia-update)
$ yarn start:electron
yarn run v1.22.15
$ yarn rebuild:electron && yarn --cwd electron-app start
$ theia rebuild:electron
native node modules are already rebuilt for electron
warning electron-app@0.0.0: The engine "vscode" appears to be invalid.
$ theia start --plugins=local-dir:../plugins

C:\theia\tool-suite\theia-ide\node_modules\bindings\bindings.js:121
        throw e;
        ^

Error: Module did not self-register: '\\?\C:\theia\tool-suite\theia-ide\node_modules\drivelist\build\Release\drivelist.node'.
    at process.func [as dlopen] (electron/js2c/asar.js:140:31)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1034:18)
    at Object.func [as .node] (electron/js2c/asar.js:140:31)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module._load (electron/js2c/asar.js:769:28)
    at Module.require (internal/modules/cjs/loader.js:852:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at bindings (C:\theia\tool-suite\theia-ide\node_modules\bindings\bindings.js:112:48)
    at Object.<anonymous> (C:\theia\tool-suite\theia-ide\node_modules\drivelist\js\index.js:25:27)

@chakraborty-slx please verify if the following is the issue you’re experiencing (bug from electron-rebuild):

1 Like