Giter Site home page Giter Site logo

Comments (7)

sdirix avatar sdirix commented on August 15, 2024 2

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.

JonasHelming avatar JonasHelming commented on August 15, 2024

Do you get the exact same error message as before?

from generator-theia-extension.

woung717 avatar woung717 commented on August 15, 2024

Do you get the exact same error message as before?

Here's the process I followed to reproduce the issue:

  1. yo theia-extension -> selected "widget" and put extension name -> yarn build:electron && yarn start:electron - this works well.
  2. I made changes to some code in the extension directory such as string contents.
  3. 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.

woung717 avatar woung717 commented on August 15, 2024

@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.

sdirix avatar sdirix commented on August 15, 2024

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.

woung717 avatar woung717 commented on August 15, 2024

@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.

woung717 avatar woung717 commented on August 15, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.