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

bug: menu fails to render #7726

Closed
vince-fugnitto opened this issue May 2, 2020 · 12 comments · Fixed by #7727
Closed

bug: menu fails to render #7726

vince-fugnitto opened this issue May 2, 2020 · 12 comments · Fixed by #7727
Labels
bug bugs found in the application critical critical bugs / problems menus issues related to the menu

Comments

@vince-fugnitto
Copy link
Member

vince-fugnitto commented May 2, 2020

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.

@vince-fugnitto vince-fugnitto added bug bugs found in the application critical critical bugs / problems labels May 2, 2020
@binary-person
Copy link

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

@binary-person
Copy link

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

@kittaakos
Copy link
Contributor

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"
},

@binary-person
Copy link

binary-person commented May 3, 2020

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)

@zhengfc
Copy link

zhengfc commented May 4, 2020

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

michalc added a commit to uktrade/data-workspace-frontend that referenced this issue May 4, 2020
michalc added a commit to uktrade/data-workspace-frontend that referenced this issue May 4, 2020
@akosyakov
Copy link
Member

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

@akosyakov akosyakov added the menus issues related to the menu label May 4, 2020
@binary-person
Copy link

I don’t think it was a missing command, as it is just a broken dependency.

kittaakos pushed a commit to SemanticApplicationDesignLanguage/sadl that referenced this issue May 4, 2020
Fix for eclipse-theia/theia#7726

Signed-off-by: Akos Kitta <kittaakos@typefox.io>
@akosyakov
Copy link
Member

akosyakov commented May 4, 2020

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

@vince-fugnitto
Copy link
Member Author

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

@vince-fugnitto
Copy link
Member Author

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?

kittaakos pushed a commit to SemanticApplicationDesignLanguage/sadl that referenced this issue May 4, 2020
Fix for eclipse-theia/theia#7726

Signed-off-by: Akos Kitta <kittaakos@typefox.io>
@akosyakov
Copy link
Member

@vince-fugnitto yes, thanks

@vince-fugnitto
Copy link
Member Author

@vince-fugnitto yes, thanks

#7733

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application critical critical bugs / problems menus issues related to the menu
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants