forcedotcom/lightning-language-server

Viewing LWC code produces errors in `LWC Language Server` tab

az-oolloow opened this issue · 5 comments

Summary

Short summary of what is going on or to provide context.

Steps To Reproduce:

  1. Open a LWC js file (sometimes takes a couple of files)
  2. Switch to LWC Language Server output tab

Expected result

There are no errors if your component is composed correctly

Actual result

[Error - 11:16:49 AM] Request textDocument/definition failed.
  Message: Request textDocument/definition failed with message: Cannot read property 'find' of undefined
  Code: -32603 

Additional information

Salesforce Extension Version in VS Code: v52.13.0

SFDX CLI Version: sfdx-cli/7.116.2 darwin-x64 node-v14.17.5

OS and version: macOS Big Sur 11.6

@az-oolloow can you provide any code that's causing this error for you? Do you have a .html file in the bundle as well?

@randi274 this is not caused by any specific file I am afraid, I tried opening all files for my components just now and it did do it on a couple, but when I cleared errors and reopened it didn't happen :( it's really hard to pinpoint as the error is so generic and non informative

This issue has been linked to a new work item: W-10018645

I was able to reproduce this with our recent LWC server work. Using the ebikes-lwc repo, attempt to click through to definition on product.MSRP__c. You'll see the error in the LWC Language Server output. Also moving this to our lwc repository for accurate tracking there.