Theia: bug: menu fails to render

Created on 3 May 2020  路  12Comments  路  Source: eclipse-theia/theia

Bug Description:

The application's main-menu fails to render due to an error with momentjs:

logger-protocol.ts:112 root ERROR TypeError: moment is not a function
    at new BlameDecorator (http://localhost:9090/64.bundle.js:458:20)
    at _createInstance (http://localhost:9090/bundle.js:46628:12)
    at Object.resolveInstance (http://localhost:9090/bundle.js:46648:18)
    at http://localhost:9090/bundle.js:46745:42
    at Array.map (<anonymous>)
    at _injectProperties (http://localhost:9090/bundle.js:46618:57)
    at Object.resolveInstance (http://localhost:9090/bundle.js:46649:18)
    at http://localhost:9090/bundle.js:46745:42
    at Object.resolve (http://localhost:9090/bundle.js:46769:12)
    at http://localhost:9090/bundle.js:45731:37
Screen Shot 2020-05-02 at 6 43 35 PM

The following error has been reported and reproduced in a number of ways:

  • docker images
  • electron-builder apps
  • 'composing applications' website guide
  • spectrum

There is an issue where others have expressed similar breaking changes for moment and they performed the same rollback in version:

Steps to Reproduce:

There are numerous ways to produce the bug, one possible way is to run the docker image, or to compose your own application following the guide from the website.

bug critical menus

Most helpful comment

Based on the PR, you can try to force the desired version of moment. I have not tried it yet; does it work if you add this to your root packages.json?

"resolutions": {
  "**/**/moment": "2.24.0"
},

All 12 comments

Also experiencing the same issue.
Reproduced with node version v10.20.1.
Followed all the steps with https://theia-ide.org/docs/composing_applications

@vince-fugnitto do you currently have a workaround available?

Based on the PR, you can try to force the desired version of moment. I have not tried it yet; does it work if you add this to your root packages.json?

"resolutions": {
  "**/**/moment": "2.24.0"
},

It does work for me. We'll have to use this as a workaround until the maintainers fix the moment version.

(First time installing theia; I thought the broken UI was really the awesome ide everyone's happy about lamo)

Based on the PR, you can try to force the desired version of moment. I have not tried it yet; does it work if you add this to your root packages.json?

"resolutions": {
  "**/**/moment": "2.24.0"
},

It work for me too, ths

There are 2 things:

  • guard such cases, i.e. the menu bar still should be there even if one command is missing
  • fix a broken command

I don鈥檛 think it was a missing command, as it is just a broken dependency.

@vince-fugnitto it is fine to pin it.

But I meant that the menu registration should not blow up the whole menu bar if one command failed to be registered.

@https://github.com/vince-fugnitto it is fine to pin it.

But I meant that the menu registration should not blow up the whole menu bar if one command failed to be registered.

Yes I agree, there should be better handling in order to prevent such issues, especially since it breaks the entire main menu.

But I meant that the menu registration should not blow up the whole menu bar if one command failed to be registered.

Should we open a follow-up issue to be more robust when creating menus/commands and not fail if one is missing?

@vince-fugnitto yes, thanks

@vince-fugnitto yes, thanks

7733

Was this page helpful?
0 / 5 - 0 ratings