Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different versions of @theia/core are causing 'Cannot apply @injectable decorator multiple times' error #7248

Closed
tsiyona opened this issue Mar 1, 2020 · 7 comments
Labels
dependencies pull requests that update a dependency file question user / developer questions

Comments

@tsiyona
Copy link

tsiyona commented Mar 1, 2020

Description

I have created a sample Theia extension using 'yo theia-extension'.
When trying to start the server I get the error: 'Failed to start the frontend application',
where the root cause is: 'Error: Cannot apply @Injectable decorator multiple times.',
reffering to @theia/core.

I checked @theia/core dependency and saw that some extensions require @theia/core version 0.15.0 and some 0.16.0,
for example, /node_modules/@theia/monaco/node_modules/@theia/core

Could this be causing the error?

I saw that a new release of @theia/core was out two days ago, which more or less matches the time this problem started for me.

Reproduction Steps

yo theia-extension
and start theia.

OS and Theia version:
Ubuntu 18.04.4

Diagnostics:
N/A

@vince-fugnitto
Copy link
Member

@tsiyona thank you for the issue!

It is not possible to mix and match versions of an extension (two extensions cannot both use @theia/core at different versions or the following failure will occur. For the generator-theia-extension there is a fix ready (eclipse-theia/generator-theia-extension#53) but it has yet to be approved and merged. In the meantime, you can update your package.json manually to remove deprecated extensions which are causing the problem.

Additional Information:

@akosyakov
Copy link
Member

oh, we should have merged it before the release 🙈 sorry I have not seen the PR

@akosyakov akosyakov added bug bugs found in the application dependencies pull requests that update a dependency file question user / developer questions and removed bug bugs found in the application labels Mar 1, 2020
@tsiyona
Copy link
Author

tsiyona commented Mar 1, 2020

I did change the versions to "latest" manually before I opened the issue. I will wait for your fix. Thank you :)

@loblab
Copy link

loblab commented Mar 1, 2020

Same issue here, running the sample generated by "yo theia-extension", following the doc, for Electron, on Windows.
My versions are all "latest" in the package.json.
Where can I modify the different versions of @theia/core? Thanks.

image

@vince-fugnitto
Copy link
Member

My versions are all "latest" in the package.json.

@loblab the issue occurs due to the fact that there are deprecated extensions included with the generator (#6933 fixes the issue but has not been released as of yet). Since these extensions have been removed prior to v0.16.0 (latest), if you include them in your application they will actually be at 0.15.0 and thus pull different versions of core.

For the moment (until the release of the updated generator), you can remove any extension as described in the following pull-request (#6933). For the generator this consists of:

  • @theia/textmate-grammars
  • @theia/typescript

@loblab
Copy link

loblab commented Mar 2, 2020

@vince-fugnitto Thanks. It works.

@vince-fugnitto
Copy link
Member

@vince-fugnitto Thanks. It works.

The generator has been updated to remove deprecated extensions causing the issue:
eclipse-theia/generator-theia-extension@3594d1f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies pull requests that update a dependency file question user / developer questions
Projects
None yet
Development

No branches or pull requests

4 participants