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/browser:0.3.8] Building 0.38 based Theia application is failing #1621

Closed
rajendra2 opened this issue Mar 31, 2018 · 6 comments
Closed

Comments

@rajendra2
Copy link

@theia/editor: error Command failed with exit code 1.
lerna ERR! execute callback with error
lerna ERR! Error: Command failed: yarn run prepare
lerna ERR! error Command failed with exit code 1.
lerna ERR! error Command failed with exit code 1.
lerna ERR!
lerna ERR! $ yarn run clean && yarn run build
lerna ERR! $ theiaext clean
lerna ERR! $ theiaext build
lerna ERR! [lint] theiaext lint exited with code 0
lerna ERR! [compile] src/browser/editor-decorations-service.ts(212,13): error TS2531: Object is possibly 'null'.
lerna ERR! [compile] theiaext compile exited with code 2
lerna ERR! info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
lerna ERR! info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
lerna ERR!
lerna ERR! at Promise.all.then.arr (/Users/rajendra/projects/deep-learning-envs/theia/node_modules/execa/index.js:236:11)
lerna ERR! at
lerna WARN complete Waiting for 3 child processes to exit. CTRL-C to exit immediately.
@theia/preferences: $ yarn run clean && yarn run build

@rajendra2
Copy link
Author

rajendra2 commented Mar 31, 2018

I am able to resolve it with following change.

diff --git a/packages/editor/src/browser/editor-decorations-service.ts b/packages/editor/src/browser/editor-decorations-service.ts
index a54f0e7f..ac131e21 100644
--- a/packages/editor/src/browser/editor-decorations-service.ts
+++ b/packages/editor/src/browser/editor-decorations-service.ts
@@ -209,7 +209,7 @@ export namespace EditorDecorationStyle {
         const index = styleSheet.insertRule('.' + selector + '{}', 0);
         const rules = styleSheet.cssRules || styleSheet.rules;
         const rule = rules.item(index);
-        if (rule.type === CSSRule.STYLE_RULE) {
+        if (rule && rule.type === CSSRule.STYLE_RULE) {
             const styleRule = rule as CSSStyleRule;
             styleProvider(styleRule.style);
         }

@marcdumais-work
Copy link
Contributor

Hi @rajendra2 ,

I just recompiled the latest Theia master branch and I do not see this compilation error (your suggested fix might still be valid).

Can you confirm it happens for you on the latest master? Which version of tsc are you using? i.e. tsc --version

@marcdumais-work
Copy link
Contributor

Also, which platform are you on running this build on?

@rajendra2
Copy link
Author

yes. I am on the latest master. I forked it some time back and synced with master yesterday.

I am building on MacOS.

./node_modules/.bin/tsc --version
Version 2.8.1

node - v8.11.1
npm 5.6.0

@kittaakos
Copy link
Contributor

@rajendra2, could you please link your fork here? I must be blind and did not find it among the forks. I would like to reproduce the defect.

Version 2.8.1

I am on 2.7.1. Do you have the same problem when you use the same version as I do? Thanks!

@svenefftinge
Copy link
Contributor

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

No branches or pull requests

4 participants