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

core: building minimal app fails #7056

Closed
paul-marechal opened this issue Feb 3, 2020 · 10 comments
Closed

core: building minimal app fails #7056

paul-marechal opened this issue Feb 3, 2020 · 10 comments
Labels
core issues related to the core of the application

Comments

@paul-marechal
Copy link
Member

paul-marechal commented Feb 3, 2020

Description

When building an application using only @theia/core, webpack fails with:

ERROR in ./node_modules/@theia/core/lib/common/lsp-types.js
Module not found: Error: Can't resolve 'vscode-languageserver-protocol' in 'D:\sources\tests\theia-prefs\node_modules\@theia\core\lib\common'
 @ ./node_modules/@theia/core/lib/common/lsp-types.js 18:39-80
 @ ./node_modules/@theia/core/lib/common/index.js
 @ ./node_modules/@theia/core/lib/browser/frontend-application-module.js
 @ ./src-gen/frontend/index.js

Not really sure why core depends on vscode-languageserver-protocol directly, but either:

  • add this package as a peer-dependency.
  • add this package as a dependency.
  • remove this dependency from core?

@akosyakov ?

Reproduction Steps

yarn init -y
yarn add @theia/core
yarn add -D @theia/cli
yarn theia build --mode development

OS and Theia version: Windows 10 - Theia 0.15.0

Diagnostics:

@paul-marechal paul-marechal added the core issues related to the core of the application label Feb 3, 2020
@vince-fugnitto
Copy link
Member

@marechal-p duplicate of #6129? Maybe report your findings there.

@paul-marechal
Copy link
Member Author

I guess mine is more up to date? In your issue it seems to fail at runtime, mine doesn't even fully builds.

@paul-marechal
Copy link
Member Author

If I manually add the missing package, it builds but then the browser app fails with:

root ERROR ./node_modules/@theia/core/lib/browser/preferences/preference-provider.js/PreferenceProvider.prototype.resolve@http://localhost:3000/bundle.js:38714:26
./node_modules/@theia/core/lib/browser/preferences/preference-provider.js/PreferenceProvider.prototype.get@http://localhost:3000/bundle.js:38711:21
./node_modules/@theia/core/lib/browser/preferences/preference-service.js/PreferenceServiceImpl.prototype.doInspectInScope@http://localhost:3000/bundle.js:39502:37
./node_modules/@theia/core/lib/browser/preferences/preference-service.js/PreferenceServiceImpl.prototype.inspectInScope@http://localhost:3000/bundle.js:39482:26
./node_modules/@theia/core/lib/browser/preferences/preference-service.js/PreferenceServiceImpl.prototype.inspect@http://localhost:3000/bundle.js:39476:32
./node_modules/@theia/core/lib/browser/common-frontend-contribution.js/CommonFrontendContribution.prototype.updateThemePreference@http://localhost:3000/bundle.js:29349:46
./node_modules/@theia/core/lib/browser/common-frontend-contribution.js/CommonFrontendContribution.prototype.init/<@http://localhost:3000/bundle.js:29340:71
./node_modules/@theia/core/lib/common/event.js/CallbackList.prototype[Symbol.iterator]/</<@http://localhost:3000/bundle.js:56976:33
./node_modules/@theia/core/lib/common/event.js/CallbackList.prototype.invoke@http://localhost:3000/bundle.js:56991:39
./node_modules/@theia/core/lib/common/event.js/Emitter.prototype.fire@http://localhost:3000/bundle.js:57078:29
./node_modules/@theia/core/lib/browser/icon-theme-service.js/IconThemeService.prototype.setCurrent@http://localhost:3000/bundle.js:33708:40
./node_modules/@theia/core/lib/browser/icon-theme-service.js/IconThemeService.prototype.register@http://localhost:3000/bundle.js:33667:18
./node_modules/@theia/core/lib/browser/icon-theme-contribution.js/DefaultFileIconThemeContribution.prototype.registerIconThemes@http://localhost:3000/bundle.js:33536:20
./node_modules/@theia/core/lib/browser/icon-theme-contribution.js/IconThemeApplicationContribution.prototype.onStart/</<@http://localhost:3000/bundle.js:33491:59
step@http://localhost:3000/bundle.js:33454:23
verb/<@http://localhost:3000/bundle.js:33435:53
./node_modules/@theia/core/lib/browser/icon-theme-contribution.js/__awaiter</<@http://localhost:3000/bundle.js:33429:71
./node_modules/@theia/core/lib/browser/icon-theme-contribution.js/__awaiter<@http://localhost:3000/bundle.js:33425:12
./node_modules/@theia/core/lib/browser/icon-theme-contribution.js/IconThemeApplicationContribution.prototype.onStart@http://localhost:3000/bundle.js:33479:16
_loop_3/</<@http://localhost:3000/bundle.js:33144:155
./node_modules/@theia/core/lib/browser/frontend-application.js/FrontendApplication.prototype.measure/</<@http://localhost:3000/bundle.js:33226:46
step@http://localhost:3000/bundle.js:32690:23
verb/<@http://localhost:3000/bundle.js:32671:53
./node_modules/@theia/core/lib/browser/frontend-application.js/__awaiter</<@http://localhost:3000/bundle.js:32665:71
./node_modules/@theia/core/lib/browser/frontend-application.js/__awaiter<@http://localhost:3000/bundle.js:32661:12
./node_modules/@theia/core/lib/browser/frontend-application.js/FrontendApplication.prototype.measure@http://localhost:3000/bundle.js:33217:16
_loop_3/<@http://localhost:3000/bundle.js:33144:69
step@http://localhost:3000/bundle.js:32690:23
verb/<@http://localhost:3000/bundle.js:32671:53
step@http://localhost:3000/bundle.js:32675:139
verb/<@http://localhost:3000/bundle.js:32671:53
fulfilled@http://localhost:3000/bundle.js:32662:58

@vince-fugnitto
Copy link
Member

I guess mine is more up to date? In your issue it seems to fail at runtime, mine doesn't even fully builds.

I still think we should only have a single issue reporting the problem and it should contain updates?
(easier to track and continue previous discussions)

@vince-fugnitto
Copy link
Member

I'll close the original in favor of this one.

@vince-fugnitto
Copy link
Member

If I manually add the missing package, it builds but then the browser app fails with:

root ERROR ./node_modules/@theia/core/lib/browser/preferences/preference-provider.js/PreferenceProvider.prototype.resolve@http://localhost:3000/bundle.js:38714:26
./node_modules/@theia/core/lib/browser/preferences/preference-provider.js/PreferenceProvider.prototype.get@http://localhost:3000/bundle.js:38711:21
./node_modules/@theia/core/lib/browser/preferences/preference-service.js/PreferenceServiceImpl.prototype.doInspectInScope@http://localhost:3000/bundle.js:39502:37
./node_modules/@theia/core/lib/browser/preferences/preference-service.js/PreferenceServiceImpl.prototype.inspectInScope@http://localhost:3000/bundle.js:39482:26
./node_modules/@theia/core/lib/browser/preferences/preference-service.js/PreferenceServiceImpl.prototype.inspect@http://localhost:3000/bundle.js:39476:32
./node_modules/@theia/core/lib/browser/common-frontend-contribution.js/CommonFrontendContribution.prototype.updateThemePreference@http://localhost:3000/bundle.js:29349:46
./node_modules/@theia/core/lib/browser/common-frontend-contribution.js/CommonFrontendContribution.prototype.init/<@http://localhost:3000/bundle.js:29340:71
./node_modules/@theia/core/lib/common/event.js/CallbackList.prototype[Symbol.iterator]/</<@http://localhost:3000/bundle.js:56976:33
./node_modules/@theia/core/lib/common/event.js/CallbackList.prototype.invoke@http://localhost:3000/bundle.js:56991:39
./node_modules/@theia/core/lib/common/event.js/Emitter.prototype.fire@http://localhost:3000/bundle.js:57078:29
./node_modules/@theia/core/lib/browser/icon-theme-service.js/IconThemeService.prototype.setCurrent@http://localhost:3000/bundle.js:33708:40
./node_modules/@theia/core/lib/browser/icon-theme-service.js/IconThemeService.prototype.register@http://localhost:3000/bundle.js:33667:18
./node_modules/@theia/core/lib/browser/icon-theme-contribution.js/DefaultFileIconThemeContribution.prototype.registerIconThemes@http://localhost:3000/bundle.js:33536:20
./node_modules/@theia/core/lib/browser/icon-theme-contribution.js/IconThemeApplicationContribution.prototype.onStart/</<@http://localhost:3000/bundle.js:33491:59
step@http://localhost:3000/bundle.js:33454:23
verb/<@http://localhost:3000/bundle.js:33435:53
./node_modules/@theia/core/lib/browser/icon-theme-contribution.js/__awaiter</<@http://localhost:3000/bundle.js:33429:71
./node_modules/@theia/core/lib/browser/icon-theme-contribution.js/__awaiter<@http://localhost:3000/bundle.js:33425:12
./node_modules/@theia/core/lib/browser/icon-theme-contribution.js/IconThemeApplicationContribution.prototype.onStart@http://localhost:3000/bundle.js:33479:16
_loop_3/</<@http://localhost:3000/bundle.js:33144:155
./node_modules/@theia/core/lib/browser/frontend-application.js/FrontendApplication.prototype.measure/</<@http://localhost:3000/bundle.js:33226:46
step@http://localhost:3000/bundle.js:32690:23
verb/<@http://localhost:3000/bundle.js:32671:53
./node_modules/@theia/core/lib/browser/frontend-application.js/__awaiter</<@http://localhost:3000/bundle.js:32665:71
./node_modules/@theia/core/lib/browser/frontend-application.js/__awaiter<@http://localhost:3000/bundle.js:32661:12
./node_modules/@theia/core/lib/browser/frontend-application.js/FrontendApplication.prototype.measure@http://localhost:3000/bundle.js:33217:16
_loop_3/<@http://localhost:3000/bundle.js:33144:69
step@http://localhost:3000/bundle.js:32690:23
verb/<@http://localhost:3000/bundle.js:32671:53
step@http://localhost:3000/bundle.js:32675:139
verb/<@http://localhost:3000/bundle.js:32671:53
fulfilled@http://localhost:3000/bundle.js:32662:58

As mentioned in the original issue, the preferences error is related to #667

@akosyakov
Copy link
Member

Why do we need lsp-types in core? Maybe it should go to @theia/languages?

@akosyakov
Copy link
Member

Also Range should be imported from vscode-languageserver-types, not protocol. That should be enough to fix.

@paul-marechal
Copy link
Member Author

Updating the import statement would fix it indeed, but should this file be moved to languages?

Right now it is used by filesystem, it would make it dependent on languages.

@akosyakov
Copy link
Member

Updating the import statement would fix it indeed, but should this file be moved to languages?

let's keep it as is

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core issues related to the core of the application
Projects
None yet
Development

No branches or pull requests

3 participants