eclipse-theia / generator-theia-extension

A Yeoman generator for extensions to the Theia IDE
Other
49 stars 37 forks source link

Watch breaks application start #176

Closed JonasHelming closed 8 months ago

JonasHelming commented 11 months ago

Create a template, e.g. hello world yarn watch on the root level change something wait until the rebuild finishes cd browser-app & yarn start

=> /home/jonas/tmp/theiatest/generatechangebuild/browser-app/lib/backend/vendors-node_modules_drivelist_build_Release_drivelist_node-node_modules_stroncium_procfs_lib-0ccbd3.js:16 throw new Error('node-loader:\n' + error); ^

Error: node-loader: Error: Module did not self-register: '/home/jonas/tmp/theiatest/generatechangebuild/browser-app/lib/backend/native/drivelist.node'. at Object.../node_modules/drivelist/build/Release/drivelist.node (/home/jonas/tmp/theiatest/generatechangebuild/browser-app/lib/backend/vendors-node_modules_drivelist_build_Release_drivelist_node-node_modules_stroncium_procfs_lib-0ccbd3.js:16:9) at webpack_require__ (/home/jonas/tmp/theiatest/generatechangebuild/browser-app/lib/backend/main.js:667:42) at module.exports (/home/jonas/tmp/theiatest/generatechangebuild/browser-app/lib/backend/main.js:155:34) at Object.../node_modules/drivelist/js/index.js (/home/jonas/tmp/theiatest/generatechangebuild/browser-app/lib/backend/vendors-node_modules_drivelist_build_Release_drivelist_node-node_modules_stroncium_procfs_lib-0ccbd3.js:30872:27) at webpack_require (/home/jonas/tmp/theiatest/generatechangebuild/browser-app/lib/backend/main.js:667:42) at Object.../node_modules/@theia/core/lib/node/env-variables/env-variables-server.js (/home/jonas/tmp/theiatest/generatechangebuild/browser-app/lib/backend/vendors-node_modules_drivelist_build_Release_drivelist_node-node_modules_stroncium_procfs_lib-0ccbd3.js:5204:19) at __webpack_require (/home/jonas/tmp/theiatest/generatechangebuild/browser-app/lib/backend/main.js:667:42) at Object.../node_modules/@theia/core/lib/node/env-variables/index.js (/home/jonas/tmp/theiatest/generatechangebuild/browser-app/lib/backend/vendors-node_modules_drivelist_build_Release_drivelist_node-node_modules_stroncium_procfs_lib-0ccbd3.js:5313:14) at __webpack_require__ (/home/jonas/tmp/theiatest/generatechangebuild/browser-app/lib/backend/main.js:667:42) at Object.../node_modules/@theia/core/lib/node/backend-application-module.js (/home/jonas/tmp/theiatest/generatechangebuild/browser-app/lib/backend/vendors-node_modules_drivelist_build_Release_drivelist_node-node_modules_stroncium_procfs_lib-0ccbd3.js:4568:25) Done in 1.19s.

JonasHelming commented 11 months ago

@sdirix do you have an idea here?

sdirix commented 11 months ago

Looking at the scripts the following is happening:

The native Node modules can only be built for either browser or electron, not both at the same time. I'm also not sure what happens when both rebuilds are executed in parallel, i.e. whether one of them then "wins" or maybe even both are broken.

drivelist.node is one of the native modules, so yarn start fails for you because it's now the electron version or broken by the parallel watch.

Suggestion: Either

JonasHelming commented 11 months ago

I would be in favor of the first option, @vince-fugnitto WDYT?

vince-fugnitto commented 11 months ago

I'd be in favor of separating the watch scripts for each application target (first option).