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

output: OutputChannelManager incorrectly imports browser code #10119

Closed
vince-fugnitto opened this issue Sep 16, 2021 · 2 comments · Fixed by #10154
Closed

output: OutputChannelManager incorrectly imports browser code #10119

vince-fugnitto opened this issue Sep 16, 2021 · 2 comments · Fixed by #10154
Labels
bug bugs found in the application output issues related to the output quality issues related to code and application quality

Comments

@vince-fugnitto
Copy link
Member

Bug Description:

The OutputChannelManager incorrectly imports browser code meaning that the backend cannot use the manager:

import { MonacoEditorModel } from '@theia/monaco/lib/browser/monaco-editor-model';
import { MonacoTextModelService, IReference } from '@theia/monaco/lib/browser/monaco-text-model-service';

The OutputChannelManager exists in common (can be used by both the browser and node) and common should not import anything:

Steps to Reproduce:

  1. attempt to import OutputChannelManager in the backend (node)
  2. the application will fail to start with the error:
Failed to start the backend application:
ReferenceError: navigator is not defined
    at /home/evinfug/workspaces/theia/node_modules/@phosphor/domutils/lib/platform.js:18:25
    at Object.<anonymous> (/home/evinfug/workspaces/theia/node_modules/@phosphor/domutils/lib/platform.js:46:3)
    at Module._compile (internal/modules/cjs/loader.js:967:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1004:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module._load (electron/js2c/asar.js:769:28)
    at Module.require (internal/modules/cjs/loader.js:852:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/evinfug/workspaces/theia/node_modules/@phosphor/domutils/lib/index.js:15:10)
@vince-fugnitto vince-fugnitto added bug bugs found in the application quality issues related to code and application quality output issues related to the output labels Sep 16, 2021
@kittaakos
Copy link
Contributor

Related #4306?

@kittaakos
Copy link
Contributor

The OutputChannelManager incorrectly imports browser

The import is correct; the module is incorrectly in common.

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 output issues related to the output quality issues related to code and application quality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants