Closed salesforceProDev closed 1 year ago
@CristiCanizales - this ticket has had the label 'stale' added to it - and whilst the ticket may have had a low level replies from yourselves over the last week or so, it is still my understanding that it is active and should remain open. Can the label be removed?
@JsalvaJ It was supposed to be solved but now it seems like it isn't. We're still investigating and will update once we have a new fix!
Howdy @bobalicious @JsalvaJ @Razvan-Racolta I built a debug version of the LWC extension with logging around when a location property is accessed. If you could download from my fork and attempt to generate the debug logging to give us an idea of where the failure is occurring that would be awesome. Find instructions and vsix in the below release. https://github.com/gbockus-sf/salesforcedx-vscode/releases/tag/0.0.3
I'm pretty sure the issue is something about how exports are structured, but haven't been able to repo based on the LayoutConstants
example above.
Thanks for your patience on this.
Thanks for the log @bobalicious Comparing it to my run locally I needed to add more info to the logs to find out where exactly the error is occurring. It appears to be making it all the way through the property and method analysis.
I uploaded a new version of the vsix here If you could send me those logs that'd be awesome.
Also if you could email me (gbockus@salesforce.com) the LWC that is resulting in the error and I could try to repo locally that'd speed this along for sure
"name": "LoadEntityForm",
"id": "Class#LoadEntityForm#15",
If not possible I totally get that. Thanks!
It'll be a few days before I'll be able to do that, but I will certainly try.
Knowing which LWC is causing the problem to appear, I may be able to reduce the test case and provide a version that is less, shall we say, private. I'll catch up with this again next week.
With the version referenced above installed, I do not get an 'LWC Language Server' output window.
There is an 'LWC Extension' output window that contains no logs whatsoever.
I can see no other output windows that contain any debug logs of the type you are looking for.
The 'Extension Host' output window contains:
2023-10-30 11:10:04.500 [error] Error: Request initialize failed with message: Cannot read properties of undefined (reading 'location')
at handleResponse (/Users/xxx/.vscode/extensions/salesforce.salesforcedx-vscode-lwc-59.0.1/dist/index.js:8728:40)
at processMessageQueue (/Users/xxx/.vscode/extensions/salesforce.salesforcedx-vscode-lwc-59.0.1/dist/index.js:8583:13)
at Immediate.<anonymous> (/Users/xxx/.vscode/extensions/salesforce.salesforcedx-vscode-lwc-59.0.1/dist/index.js:8569:11)
at processImmediate (node:internal/timers:476:21)
I have attempted to replicate the issue using only the LoadEntityForm LWC and it does not occur with that LWC, and so I am not forwarding it on to you.
@gbockus-sf / @CristiCanizales - I believe I've found the shape of LWC that causes the issue.
It is a pattern where you create a setter but no corresponding getter.
E.g. an LWC that consists solely of the following:
import { LightningElement } from 'lwc';
export default class PropertySetterWithNoGetter extends LightningElement {
_property = '';
set property( value ) {
this._property = value;
}
}
Please do not discuss as to why this would be desirable - it is a perfectly valid block of code and I am aware that there are other ways of doing the same thing. This example exists purely to show how to get the Lightning Web Components extension to crash.
(Note: this pattern did not exist in LoadEntityForm, it was in an entirely different LWC, so I'm not sure what happened with the logging)
💥 Thanks @bobalicious I repo'd locally and will see what we can do to get it resolved.
This issue has been linked to a new work item: W-14391061
Fixed with the 59.3.1 Release. Thanks for working with us to get this issue resolved. 🥳 🎉
Confirmed as fixed from my perspective
Summary
On VScode loading getting this error all the time: Request initialize failed with message: Cannot read properties of undefined (reading 'location') (Lightning Web Components Extension)
Steps To Reproduce:
Expected result
There should be no error the vsCode extensions should initialize without any error
Actual result
Getting error: Request initialize failed with message: Cannot read properties of undefined (reading 'location')
Additional information
Tried to uninstall and install all the extensions back, but didn't work.
Salesforce Extension Version in VS Code:
SFDX CLI Version: sfdx-cli/7.209.6 win32-x64 node-v18.15.0
OS and version: Window 11 64bit