Comments (7)
Yes, that is how it is set up at the moment. However we should do an improvement so that there is a separate build command for the extensions in addition to prepare
.
from generator-theia-extension.
Do you get the exact same error message as before?
from generator-theia-extension.
Do you get the exact same error message as before?
Here's the process I followed to reproduce the issue:
yo theia-extension -> selected "widget" and put extension name -> yarn build:electron && yarn start:electron
- this works well.- I made changes to some code in the extension directory such as string contents.
npm rebuild (at /electron-app) && yarn build:electron && yarn start:electron
- this does not work; it exits immediately.
Moreover, when executing Run&Debug "Start Electron Backend," I received the following error message:
/{ProjectRootDir}/node_modules/.bin/electron ./electron-app/src-gen/backend/electron-main.js --loglevel=debug --hostname=localhost --no-cluster
Debugger listening on ws://127.0.0.1:53702/7956f222-1497-4900-8ef9-b425b5b9d50f
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
Debugger listening on ws://127.0.0.1:53705/ceb1780f-9b18-4bd4-941d-d3f6b0a5a131
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
Showing main window early
Electron [file]
Positionals:
file [string]
Options:
--help Show help [boolean]
--version Show version number [boolean]
--electronUserData The area where the electron main process puts its data
[string]
Error: Module did not self-register: '/{ProjectRootDir}/node_modules/drivelist/build/Release/drivelist.node'.
at process.func [as dlopen] (node:electron/js2c/asar_bundle:2:1822)
at Module._extensions..node (node:internal/modules/cjs/loader:1259:18)
at Object.func [as .node] (node:electron/js2c/asar_bundle:2:1822)
at Module.load (node:internal/modules/cjs/loader:1044:32)
at Module._load (node:internal/modules/cjs/loader:885:12)
at f._load (node:electron/js2c/asar_bundle:2:13330)
at Module.require (node:internal/modules/cjs/loader:1068:19)
at require (node:internal/modules/cjs/helpers:103:18)
at bindings (/{ProjectRootDir}/node_modules/bindings/bindings.js:112:48)
at Object.<anonymous> (/{ProjectRootDir}/node_modules/drivelist/js/index.js:25:27) {
code: 'ERR_DLOPEN_FAILED'
}
Waiting for the debugger to disconnect...
To handle this, I removed '.browser_modules' and 'node_module' directories and ran yarn install. It helped to some extent as the 'Run&Debug "Start Electron Backend"' started working, but the problematic 'yarn build:electron && yarn start:electron' command remains unresolved.
And if I build/run in wrong way, please let me know. Thank you for your reply.
ps. redacted some of paths
from generator-theia-extension.
@JonasHelming
I finally figured out how to build the extension and deploy it to the electron app properly.
I had to build the extension using npm run build
in the extension directory and then run yarn build:electron && yarn start:electron
. Previous approaches may have caused problems as I tried to build electron-app directly using npm rebuild
in the electron-app directory.
I think it would be good to include some sort of guide to building extensions and deploying to electron-app in the README file or somewhere for newbies. The build commands are different from the Theia project document. (ex. There is no yarn rebuild:electron
command in generated extension project)
from generator-theia-extension.
Hi @woung717,
You are right. What we are missing is a convenient "build" script in the root which builds all extensions. At the moment the build of the extension is only triggered when executing yarn
(via the prepare
step) or when executing yarn watch:browser
/ yarn watch:electron
.
The rebuild command is misleading. It's only about the native Node dependencies in node_modules
and unrelated to the source code itself.
from generator-theia-extension.
@sdirix Thanks for the confirmation. Now I understand the structure of the build scripts.
Then yarn prepare
(build extensions) -> yarn build:electron && yarn start:electron
(build electron app with the built extension) is the standard way to check changes without the watch option?
from generator-theia-extension.
Thank you guys, it helps a lot to start with the Theia project. Have a nice day! @JonasHelming @sdirix
from generator-theia-extension.
Related Issues (20)
- [backend] The backend example is not connection scoped HOT 2
- tree: fix `tree-editor` template
- ci: bump node version
- Require Node 14 before generating templates
- tree-editor: build failures HOT 1
- widget does not position in the default area HOT 2
- Error: Command failed: npm run prepare HOT 7
- errors: there are a number of build errors during CI HOT 2
- Generated electron-app does not work anymore
- widget menu click error HOT 4
- Scaffolding start error HOT 5
- Error when starting Theia (hello world template) HOT 3
- Watch breaks application start HOT 4
- Need for a theia clean or build:clean HOT 3
- `-4058 scandir ENOENT` error occurred when creating the `TreeEditor` extension HOT 8
- run "yo theia-extension" Error theia-extension HOT 8
- generator-theia-extension fails on all generators HOT 1
- Error when starting theia-extension template
- Can't start browser after starting electron HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from generator-theia-extension.