forcedotcom / salesforcedx-vscode

Salesforce Extensions for VS Code
https://developer.salesforce.com/tools/vscode
BSD 3-Clause "New" or "Revised" License
947 stars 406 forks source link

The LWC Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted for version Version: 1.93.1 #5869

Open jean-feng opened 2 days ago

jean-feng commented 2 days ago

Summary

The LWC Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted.

Steps To Reproduce:

I got a new C driver, installed new Windows: Edition Windows 10 Enterprise Version 22H2 Installed on ‎9/‎6/‎2024 OS build 19045.4894 Experience Windows Feature Experience Pack 1000.19060.1000.0

Then I installed sf @salesforce/cli/2.58.7 win32-x64 node-v20.17.0

Java JDK-21

Visual Studio Code Version: 1.93.1 (user setup) Commit: 38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40 Date: 2024-09-11T17:20:05.685Z Electron: 30.4.0 ElectronBuildId: 10073054 Chromium: 124.0.6367.243 Node.js: 20.15.1 V8: 12.4.254.20-electron.0 OS: Windows_NT x64 10.0.19045

Once I installed Salesforce Extension Pack v61.12.0

I got The LWC Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted.

Expected result

Describe what should have happened.

Actual result

c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\sax\lib\sax.js:658 er = new Error(er) ^

Error: Unexpected close tag Line: 1886 Column: 15 Char: > at error (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\sax\lib\sax.js:658:10) at strictFail (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\sax\lib\sax.js:684:7) at closeTag (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\sax\lib\sax.js:878:9) at SAXParser.write (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\sax\lib\sax.js:1460:13) at exports.Parser.Parser.parseString (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\xml2js\lib\parser.js:323:31) at Parser.parseString (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\xml2js\lib\parser.js:5:59) at c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\xml2js\lib\parser.js:338:24 at new Promise () at exports.Parser.Parser.parseStringPromise (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\xml2js\lib\parser.js:336:14) at Parser.parseStringPromise (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\xml2js\lib\parser.js:5:59)

Node.js v20.15.1 [Info - 10:54:56 AM] Connection to server got closed. Server will restart. c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\sax\lib\sax.js:658 er = new Error(er) ^

Error: Unexpected close tag Line: 1886 Column: 15 Char: > at error (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\sax\lib\sax.js:658:10) at strictFail (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\sax\lib\sax.js:684:7) at closeTag (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\sax\lib\sax.js:878:9) at SAXParser.write (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\sax\lib\sax.js:1460:13) at exports.Parser.Parser.parseString (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\xml2js\lib\parser.js:323:31) at Parser.parseString (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\xml2js\lib\parser.js:5:59) at c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\xml2js\lib\parser.js:338:24 at new Promise () at exports.Parser.Parser.parseStringPromise (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\xml2js\lib\parser.js:336:14) at Parser.parseStringPromise (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\xml2js\lib\parser.js:5:59)

Node.js v20.15.1 [Info - 10:55:10 AM] Connection to server got closed. Server will restart. c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\sax\lib\sax.js:658 er = new Error(er) ^

Error: Unexpected close tag Line: 1886 Column: 15 Char: > at error (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\sax\lib\sax.js:658:10) at strictFail (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\sax\lib\sax.js:684:7) at closeTag (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\sax\lib\sax.js:878:9) at SAXParser.write (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\sax\lib\sax.js:1460:13) at exports.Parser.Parser.parseString (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\xml2js\lib\parser.js:323:31) at Parser.parseString (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\xml2js\lib\parser.js:5:59) at c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\xml2js\lib\parser.js:338:24 at new Promise () at exports.Parser.Parser.parseStringPromise (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\xml2js\lib\parser.js:336:14) at Parser.parseStringPromise (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\xml2js\lib\parser.js:5:59)

Node.js v20.15.1 [Info - 10:55:21 AM] Connection to server got closed. Server will restart. c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\sax\lib\sax.js:658 er = new Error(er) ^

Error: Unexpected close tag Line: 1886 Column: 15 Char: > at error (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\sax\lib\sax.js:658:10) at strictFail (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\sax\lib\sax.js:684:7) at closeTag (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\sax\lib\sax.js:878:9) at SAXParser.write (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\sax\lib\sax.js:1460:13) at exports.Parser.Parser.parseString (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\xml2js\lib\parser.js:323:31) at Parser.parseString (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\xml2js\lib\parser.js:5:59) at c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\xml2js\lib\parser.js:338:24 at new Promise () at exports.Parser.Parser.parseStringPromise (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\xml2js\lib\parser.js:336:14) at Parser.parseStringPromise (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\xml2js\lib\parser.js:5:59)

Node.js v20.15.1 [Info - 10:55:33 AM] Connection to server got closed. Server will restart. c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\sax\lib\sax.js:658 er = new Error(er) ^

Error: Unexpected close tag Line: 1886 Column: 15 Char: > at error (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\sax\lib\sax.js:658:10) at strictFail (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\sax\lib\sax.js:684:7) at closeTag (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\sax\lib\sax.js:878:9) at SAXParser.write (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\sax\lib\sax.js:1460:13) at exports.Parser.Parser.parseString (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\xml2js\lib\parser.js:323:31) at Parser.parseString (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\xml2js\lib\parser.js:5:59) at c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\xml2js\lib\parser.js:338:24 at new Promise () at exports.Parser.Parser.parseStringPromise (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\xml2js\lib\parser.js:336:14) at Parser.parseStringPromise (c:\Users\yfeng.vscode\extensions\salesforce.salesforcedx-vscode-lwc-61.12.0\node_modules\xml2js\lib\parser.js:5:59)

Node.js v20.15.1 [Error - 10:55:45 AM] Connection to server got closed. Server will not be restarted.

Additional information

Feel free to attach a screenshot.

Salesforce Extension Version in VS Code:

Salesforce CLI Version:

OS and version:

VS Code version:

Most recent version of the extensions where this was working:

svc-idee-bot commented 2 days ago

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

svc-idee-bot commented 2 days ago

Hello @jean-feng :wave: It looks like you didn't provide all the required basic info in your issue.

If you haven't already, please provide the following info: Salesforce Extension Version in VS Code: Salesforce CLI Version: OS and version: VS Code version: Most recent version of the extensions where this was working:

Here's an example of a set of required info that will pass the validation: Salesforce Extension Version in VS Code: 60.13.0 Salesforce CLI Version: @salesforce/cli/2.42.6 darwin-arm64 node-v18.18.2 OS and version: MacOS Sonoma 14.5 VS Code version: 1.89.1 Most recent version of the extensions where this was working: 60.11.0

A few more things to check:

Thank you!

peternhale commented 2 days ago

@jean-feng tell me about your project, was an existing opened after the upgrades or was it a new project.

Given the error, the LWC language server is trying to parse a xml file. Do you have any xml files in your project with the string "er = new Error(er)" If so, could you share the details of that file here.

Could you also try creating a new project to see if the LWC language server starts properly?

jean-feng commented 2 days ago

@peternhale I pull the branch from repository since everything in my C is new and I followed normal instructions for salesforc deployment processes since I already changed PC for couple of times in the past. Only difference is I downloaded the newest version for each step as before. In the beginning, everything seems good and I did not pay attention to the extension errors. since I can retrieve existing component like Apex code that I modified until I added some metadata in salesforce. When I tried to download those custom metadata, I got "Missing fullName on CustomLabel in \force-app\main\default\labels\CustomLabels.labels-meta.xml" even that is not label at all. And then I went to existing customLabel, and I tried to retrieve it, and then I saw "LWC language server error". Then I uninstalled Salesforce Extension Pack, removed all the extension, and installed it again, then I noticed "LWC language server error". I still can pull existing ApexClass or custom metadata, however, when I tried to retrieve ApexPage, and then I got this "LWC language server error" too without retrieving. This is just wired. The Org Browser for downloading any existing stuff, first pop up "Are you sure you want to overwrite error.." Once you click overwrite button, I got Missing fullName on CustomLabel in \force-app\main\default\labels\CustomLabels.labels-meta.xml". Nothing is changed in fullsb or prod, If I tried to download anything, I got the same error also. I just think something wrong with VSCode. Actually, I redo everything in one drive again, The same thing still happened. My C driver is new including window operation system since Dell replaced my C drive. The project is pull current branch.

jean-feng commented 2 days ago

@peternhale I think I resolved the issue. Someone checked in customLabel with extra starting tag, once I fixed that, I dont see LWS Language Server crashed error and I am able to download and retrieve without problem. Sorry for the confusion.

peternhale commented 2 days ago

@jean-feng thanks for letting us know, however, the language server should not crash like this for a malformed file. Would you be willing to share the breaking change so I might file a bug, so we can have a look at the root cause and fix it if possible?

jean-feng commented 1 day ago

I can reproduce it:

  1. I added a starting tag in customLabel xml file without an ending tag.
  2. Save it
  3. Go to any extensions, either install or uninstall, you will see that error I showed you before.
  4. I think if you tried to retrieve some xml, I got that error too.

Only thing I fixed in my project is customLabel xml file, and then all is working. I already check In work items so far and all is still good. From: peternhale @.> Sent: Tuesday, September 24, 2024 4:22 PM To: forcedotcom/salesforcedx-vscode @.> Cc: Jean Feng @.>; Mention @.> Subject: Re: [forcedotcom/salesforcedx-vscode] The LWC Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted for version Version: 1.93.1 (Issue #5869)

[EXTERNAL]

@jean-fenghttps://github.com/jean-feng thanks for letting us know, however, the language server should not crash like this for a malformed file. Would you be willing to share the breaking change so I might file a bug, so we can have a look at the root cause and fix it if possible?

— Reply to this email directly, view it on GitHubhttps://github.com/forcedotcom/salesforcedx-vscode/issues/5869#issuecomment-2372300714, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AGBSBTLJIBGV24O4GJHNMY3ZYHCVRAVCNFSM6AAAAABOYQOCESVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNZSGMYDANZRGQ. You are receiving this because you were mentioned.Message ID: @.***>

git2gus[bot] commented 1 day ago

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

peternhale commented 1 day ago

@jean-feng thank for the reproduction steps. I was able to cause the error. I am logging a bug.