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

Theia Extension Cannot apply @injectable decorator multiple times. #7390

Closed
dhananjayharel opened this issue Mar 21, 2020 · 2 comments
Closed
Labels
question user / developer questions

Comments

@dhananjayharel
Copy link

dhananjayharel commented Mar 21, 2020

Description

I cannot create a new theia extension since today.
When I create a new helloworld extension by typing 'yo theia-extension xxxx'
it compiles but when I start the theia app and see the browser then the console shows following error

index.js:61 Failed to start the frontend application.
(anonymous) @ index.js:61
Promise.catch (async)
./src-gen/frontend/index.js @ index.js:60
__webpack_require__ @ bootstrap:63
(anonymous) @ bootstrap:198
(anonymous) @ bootstrap:198

index.js:63 Error: Cannot apply @injectable decorator multiple times.
    at injectable.js:8
    at DecorateConstructor (Reflect.js:541)
    at Object.decorate (Reflect.js:130)
    at _decorate (decorator_utils.js:42)
    at Object.decorate (decorator_utils.js:55)
    at Object.../node_modules/@theia/variable-resolver/node_modules/@theia/core/lib/browser/widgets/widget.js (widget.ts:27)
    at __webpack_require__ (bootstrap:63)
    at Object.../node_modules/@theia/variable-resolver/node_modules/@theia/core/lib/browser/widgets/index.js (index.ts:17)
    at __webpack_require__ (bootstrap:63)
    at Object.../node_modules/@theia/variable-resolver/node_modules/@theia/core/lib/browser/dialogs.js (dialogs.ts:20)

Here is the package.json in by browser-app

{
  "private": true,
  "name": "browser-app",
  "version": "0.0.0",
  "dependencies": {
    "@theia/core": "latest",
    "@theia/filesystem": "latest",
    "@theia/workspace": "latest",
    "@theia/preferences": "latest",
    "@theia/navigator": "latest",
    "@theia/process": "latest",
    "@theia/terminal": "latest",
    "@theia/editor": "latest",
    "@theia/languages": "latest",
    "@theia/markers": "latest",
    "@theia/monaco": "latest",
    "@theia/typescript": "latest",
    "@theia/messages": "latest",
    "programmr_php7": "0.0.0"
  },
  "devDependencies": {
    "@theia/cli": "latest"
  },
  "scripts": {
    "prepare": "theia build --mode development",    
    "start": "theia start",
    "watch": "theia build --watch --mode development"
  },
  "theia": {
    "target": "browser"
  }
}

Reproduction Steps

OS and Theia version:
Yarn version: 1.15.2
yo version: 2.0.6
Node version:10.15.3

Diagnostics:

@vince-fugnitto vince-fugnitto added the question user / developer questions label Mar 22, 2020
@vince-fugnitto
Copy link
Member

@dhananjayharel the error occurs since @theia/typescript has been deprecated and it's latest version is thus behind all other extensions.

It is generally not possible to mix-match versions of theia extensions as they will each pull different versions of @theia/core for instance which cannot be resolved, causing the multi-injector issue.

Checking npm you can see that @theia/typescript latest points to 0.15.0, while another extension like @theia/getting-started is at 0.16.1.

Screen Shot 2020-03-21 at 10 07 14 PM

Screen Shot 2020-03-21 at 10 07 30 PM

The fix has been made on the generator already in the most up-to-date version: eclipse-theia/generator-theia-extension#53

Additional Info:

@dhananjayharel
Copy link
Author

Thanks.
I can compile the plugin after updating the plugin generator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question user / developer questions
Projects
None yet
Development

No branches or pull requests

2 participants