eclipse-theia / theia

Eclipse Theia is a cloud & desktop IDE framework implemented in TypeScript.
http://theia-ide.org
Eclipse Public License 2.0
20.06k stars 2.5k forks source link

git widget init fail after packaged #13479

Open fanyipin opened 8 months ago

fanyipin commented 8 months ago

Bug Description:

when application require @theia/git, the webpack will handle git-locator-host as a entry; but the git-locator-host file don't require the reflect-metadata module. when run,the Error 'Reflect.hasOwnMetadata is not a function' will throw. therefore the git child_process is cannot run.

Steps to Reproduce:

  1. add @theia/git in package.json
  2. start application

Additional Information

JonasHelming commented 8 months ago

We are about to deprecate the Theia/git extension, we recommen using the built-in VS Code extension instead. See https://github.com/eclipse-theia/theia/issues/12745

fanyipin commented 8 months ago

Ok, I understand, but do you still need to fix the problem for historical projects? At present, the latest code makes a separate entrance for @theia/git when webpack is packaged。I think the problems I have encountered so far are mainly caused by the lack of modules。https://github.com/eclipse-theia/theia/pull/13487

JonasHelming commented 8 months ago

Is the link above correct? It does not show a PR for me.

fanyipin commented 8 months ago

Is the link above correct? It does not show a PR for me.

Sorry, it seems like there's still a problem with my PR submission. I noticed that there's a check failure in this PR, which indicates that the Author did not have a signed ECA on file.

fanyipin commented 8 months ago

Is the link above correct? It does not show a PR for me.

it's ok; Please review these changes in this pull request when you have a moment; Thanks

fanyipin commented 8 months ago

Is the link above correct? It does not show a PR for me.

it's ok; Please review these changes in this pull request when you have a moment; Thanks

jfaltermeier commented 8 months ago

Hi, I tried to reproduce the error, but I don't get the 'Reflect.hasOwnMetadata is not a function' error and git seems to be working fine.

For testing I used https://github.com/eclipse-theia/generator-theia-extension and generated an empty extension, then added @theia/git to the electron and browser application.

Do you get the error with these steps as well? Which node version are you using?

fanyipin commented 7 months ago

Sorry for just seeing this response. In such a scenario, when a project has not been initialized with git from the beginning and subsequently the git init command is run within the terminal, git components will not reflect the most recent file changes. This occurs because the mechanism for monitoring changes is facilitated by ipc-bootstrap file that launches a subordinate process, which in turn loads the git-locator-host module while operating in a multi-processing context. Therefore, pertinent error information is not displayed directly in the console output.