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”
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!