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

In hosted-instance-log: "TypeError: Cannot read property 'path' of undefined" from vscode-builtin-json-language-feature #19485

Closed
4 of 23 tasks
apupier opened this issue Apr 1, 2021 · 10 comments
Assignees
Labels
area/editor/theia Issues related to the che-theia IDE of Che kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system.
Milestone

Comments

@apupier
Copy link
Contributor

apupier commented Apr 1, 2021

Describe the bug

stack error in hosted-instance-log when staring a workspace:

Extension-Host:Promise rejection not handled in one second: TypeError: Cannot read property 'path' of undefined , reason: TypeError: Cannot read property 'path' of undefined
Extension-Host:With stack trace: TypeError: Cannot read property 'path' of undefined
    at Object.a [as joinPath] (/default-theia-plugins/vscode-builtin-json-language-features/extension/client/dist/node/jsonClientMain.js:1:248754)
    at /default-theia-plugins/vscode-builtin-json-language-features/extension/client/dist/node/jsonClientMain.js:1:116514
    at Array.forEach (<anonymous>)
    at /default-theia-plugins/vscode-builtin-json-language-features/extension/client/dist/node/jsonClientMain.js:1:116371
    at Array.forEach (<anonymous>)
    at f (/default-theia-plugins/vscode-builtin-json-language-features/extension/client/dist/node/jsonClientMain.js:1:116229)
    at /default-theia-plugins/vscode-builtin-json-language-features/extension/client/dist/node/jsonClientMain.js:1:122454

Che version

  • latest
  • nightly
  • other: please specify 7.28.0

Steps to reproduce

  1. Start Camel K stack
  2. look inside the hosted-instance-log output

Expected behavior

Runtime

  • kubernetes (include output of kubectl version)
  • Openshift (include output of oc version)
  • minikube (include output of minikube version and kubectl version)
  • minishift (include output of minishift version and oc version)
  • docker-desktop + K8S (include output of docker version and kubectl version)
  • other: (please specify)

Screenshots

Installation method

  • chectl
    • provide a full command that was used to deploy Eclipse Che (including the output)
    • provide an output of chectl version command
  • OperatorHub
  • I don't know

Environment

  • my computer
    • Windows
    • Linux
    • macOS
  • Cloud
    • Amazon
    • Azure
    • GCE
    • other (please specify)
  • Dev Sandbox (workspaces.openshift.com)
  • other: please specify

Eclipse Che Logs

Additional context

@apupier apupier added the kind/bug Outline of a bug - must adhere to the bug report template. label Apr 1, 2021
@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Apr 1, 2021
@apupier
Copy link
Contributor Author

apupier commented Apr 2, 2021

it happens on several workspaces. tested with Camel K and Java Maven

@olexii4 olexii4 added severity/P1 Has a major impact to usage or development of the system. area/editor/theia Issues related to the che-theia IDE of Che and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Apr 2, 2021
@ericwill ericwill mentioned this issue Apr 8, 2021
42 tasks
@ericwill ericwill added this to the 7.30 milestone Apr 14, 2021
@kibblerz
Copy link

I'm also experiencing this issue.

Array.isArray(r) && r.forEach(n => { let { fileMatch: r, url: o } = n; if ("string" == typeof r && (r = [r]), Array.isArray(r) && "string" == typeof o) { let n = o; "." === n[0] && "/" === n[1] && (n = a.joinPath(e.extensionUri, n).toString()), r = r.map(e => ("%" === e[0] ? e = (e = (e = e.replace(/%APP_SETTINGS_HOME%/, "/User")).replace(/%MACHINE_SETTINGS_HOME%/, "/Machine")).replace(/%APP_WORKSPACES_HOME%/, "/Workspaces")

This seems to be the piece of code the error is occurring at, for some reason the extensions aren't getting valid Uri's?

@tsmaeder
Copy link
Contributor

On obvious problem is that in Theia, the URI class does not declare a joinPath method.

@bfitzpat
Copy link

bfitzpat commented Apr 26, 2021

I encountered this on a sandbox CRW instance with this devfile from @sunix - https://sunix-che-devfile-registry-3twww.surge.sh/devfiles/quarkus/devfile.yaml

@apupier
Copy link
Contributor Author

apupier commented Apr 26, 2021

On obvious problem is that in Theia, the URI class does not declare a joinPath method.

for reference eclipse-theia/theia#8752

@tsmaeder
Copy link
Contributor

Bit of a 🤦‍♂️ moment here: while i have a fix for the upstream problem eclipse-theia/theia#8752, it turns out that I was looking at the wrong version of the json extension: 1.49.3 vs. 1.50.1. In 1.50.1, the extension implements a 'joinPath' function, which accesses the Extension.extensionUri field, which is not implemented in Theia.

@tsmaeder
Copy link
Contributor

tsmaeder commented May 3, 2021

I implemented the extensionURI stuff. However, when I open a package.json in the editor, I get an error message complaining it can't load the schema from a uri like 'combinedschema://schemaservice/chepluginresource:/...`.
It seems the json language service living at https://github.com/microsoft/vscode-json-languageservice gets its knickers in a twist on some non-standard URI's, see for example microsoft/vscode#115419. Note that the issue has been closed very recently, so this might be fixed in a new version of the plugin than what we have.

@apupier
Copy link
Contributor Author

apupier commented Aug 5, 2021

still occuring with CRW 2.10 (so Che 7.32.2)

Extension-Host:Promise rejection not handled in one second: TypeError: Cannot read property 'path' of undefined , reason: TypeError: Cannot read property 'path' of undefined
Extension-Host:With stack trace: TypeError: Cannot read property 'path' of undefined
    at Object.a [as joinPath] (/default-theia-plugins/vscode-builtin-json-language-features/extension/client/dist/node/jsonClientMain.js:1:248754)
    at /default-theia-plugins/vscode-builtin-json-language-features/extension/client/dist/node/jsonClientMain.js:1:116514
    at Array.forEach (<anonymous>)
    at /default-theia-plugins/vscode-builtin-json-language-features/extension/client/dist/node/jsonClientMain.js:1:116371
    at Array.forEach (<anonymous>)
    at f (/default-theia-plugins/vscode-builtin-json-language-features/extension/client/dist/node/jsonClientMain.js:1:116229)
    at /default-theia-plugins/vscode-builtin-json-language-features/extension/client/dist/node/jsonClientMain.js:1:122454

@tsmaeder
Copy link
Contributor

@apupier I can create a "Java maven" workspace with no problems on https://che-dogfooding.apps.che-dev.x6e0.p1.openshiftapps.com/ Can we close this one?

@apupier
Copy link
Contributor Author

apupier commented Oct 29, 2021

if you have no error in log, yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/editor/theia Issues related to the che-theia IDE of Che kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system.
Projects
None yet
Development

No branches or pull requests

8 participants