forcedotcom / salesforcedx-vscode

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

Vs Code Extension Error Initializing #5069

Closed salesforceProDev closed 10 months ago

salesforceProDev commented 1 year ago

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:

  1. Open VsCode.
  2. Let the extensions initialize
  3. There is error on the bottom right corner "Request initialize failed with message: Cannot read properties of undefined (reading 'location')"

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.

Screenshot 2023-09-02 110217

Salesforce Extension Version in VS Code:

salesforce.salesforcedx-vscode-lwc --> version: v58.14.1

SFDX CLI Version: sfdx-cli/7.209.6 win32-x64 node-v18.15.0

OS and version: Window 11 64bit

JsalvaJ commented 1 year ago

I have the same error. I didn't have it 4 weeks ago. I tried to reinstall the extension package too. I tried to download the code again and it didn't work.

image

CristiCanizales commented 1 year ago

Hello @salesforceDev-role, @JsalvaJ! Are you also getting this error with v58.14.2? We released it 2 days ago, so can you try updating and check if it is still happening?

KevinLaurence commented 1 year ago

Hi @CristiCanizales I am also experiencing this issue with version 58.14.2. The extension cannot be updated, and uninstalling and then reinstalling it also does not work. The error message in the log is "ERR CorruptZip: end of central directory record signature not found".

salesforceProDev commented 1 year ago

Hi @CristiCanizales, Thanks for your response but updating the extension to version v58.14.2, giving the same error message. Attaching the screenshot for your reference.

Lightning_WebComponent extension VsCode Error
CristiCanizales commented 1 year ago

Hi @salesforceDev-role, @KevinLaurence, @JsalvaJ

If you try installing the vsixes at the bottom of this page, do you still get the same error?

To install just go to extensions view, click the 3 dots at the top right of the sidebar, click install from vsixes and select all the files in the zip (previously unzipped):

image
KevinLaurence commented 1 year ago

Hi @salesforceDev-role, @KevinLaurence, @JsalvaJ

If you try installing the vsixes at the bottom of this page, do you still get the same error?

To install just go to extensions view, click the 3 dots at the top right of the sidebar, click install from vsixes and select all the files in the zip (previously unzipped): image

Yes, the error message was the same:

[error] end of central directory record signature not found: CorruptZip: end of central directory record signature not found

CristiCanizales commented 1 year ago

If you downgrade to previous versions, like v58.13.1 or v58.11.0, do you still get the same error?

salesforceProDev commented 1 year ago

@CristiCanizales ,

  1. I've tried downgrading the version of the extension as well to v58.11.0, no change the same error message is popping up my screen. Attaching the screenshot for your reference.
LWC Extension VsCode Lower Version
  1. Tried installing from VSIX, its giving same error message.
CristiCanizales commented 1 year ago

@salesforceDev-role I see.. I believe it's something with your system then, because it's happening with every version, even v58.11.0 which is 3 releases previous to the creation of this issue.

Could you tell me your VS Code version? and also maybe try reinstalling/updating VS Code?

salesforceProDev commented 1 year ago

@CristiCanizales, Oh ok I'll try to reinstall it, will update you.

Please find the below versions

VSCode : Version: 1.82.1 (user setup) Electron: 25.8.0 ElectronBuildId: 23503258 Chromium: 114.0.5735.289 Node.js: 18.15.0 V8: 11.4.183.29-electron.0 OS: Windows_NT x64 10.0.22621

salesforceProDev commented 1 year ago

@CristiCanizales , reinstalling is not resolving the issue.

Lets assume if this is a system specific issue, but then why does everyone else also have the same concern?

CristiCanizales commented 1 year ago

@salesforceDev-role I know...😓 It's just weird that before v58.14.1 you all were not having issues with previous versions and now you do, and those vsixes for the previous versions didn't change at all... nor anything for the lwc extension

@JsalvaJ, @KevinLaurence would you please tell me your system info too? OS, vscode version, etc

KevinLaurence commented 1 year ago

@CristiCanizales My system info is as follows:

Version: 1.82.1 (user setup) Commit: 6509174151d557a81c9d0b5f8a5a1e9274db5585 Date: 2023-09-08T08:45:05.575Z Electron: 25.8.0 ElectronBuildId: 23503258 Chromium: 114.0.5735.289 Node.js: 18.15.0 V8: 11.4.183.29-electron.0 OS: Windows_NT x64 10.0.19044

In the last 24 hours I have uninstalled all the Salesforce VS Code extensions and reinstalled an earlier version of VS Code. Then attempted to install the Salesforce Extension Pack, which failed.

I then let VS Code upgrade to the latest version (1.82.1) and again tried to install the SF Extension Pack which failed. Then I installed each extension separately and they all installed successfully, with the exception of the LWC extension again.

So, it seems to me that there is something different about salesforce.salesforcedx-vscode-lwc-58.14.2.vsix compared to the other extension files.

CristiCanizales commented 1 year ago

@KevinLaurence just to confirm, do you have ESLint extension installed and enabled? It's a dependency for LWC extension

JsalvaJ commented 1 year ago

Hello @cristiCanizales, here is my system info. image

JsalvaJ commented 1 year ago

I tried to uninstall and reinstall all the things but the error is still ocurring.

KevinLaurence commented 1 year ago

@KevinLaurence just to confirm, do you have ESLint extension installed and enabled? It's a dependency for LWC extension

@CristiCanizales Yes, I have version 2.4.2 installed and it is enabled.

KevinLaurence commented 1 year ago

@CristiCanizales I have at least one other colleague who has the same problem with the Lightning Web Components extension and he is running version 58.11.0.

gianlucaghezzi24 commented 1 year ago

I all I have the same problem with the Lightning Web Components extension version v58.14.2 having also the ESLint extension installed version v2.4.2

salesforceProDev commented 1 year ago

@CristiCanizales what should be done now for the resolution of the same? Even the same issue I and all my colleagues are facing in their work systems

SalesforceAlexS commented 1 year ago

Same issue https://github.com/forcedotcom/salesforcedx-vscode/issues/5099

rob-baillie-ortoo commented 1 year ago

Also experiencing this on macOs

JsalvaJ commented 1 year ago

Do you know something about it? I reinstalled VSC and extensions and I have the same error. @CristiCanizales do you have any news? Thks.

CristiCanizales commented 1 year ago

Hello everyone. We're currently digging into this, it's hard because any of us are facing the issue thus we haven't been able to reproduce it. We'll let you know when we have updates! Sorry for the inconveniences

bobalicious commented 1 year ago

Have upgraded Java from:

Error in Extensions Host is:

2023-09-20 08:40:23.500 [error] Error: Request initialize failed with message: Cannot read properties of undefined (reading 'location')
    at be (/Users/xxxx/.vscode/extensions/salesforce.salesforcedx-vscode-lwc-58.14.2/dist/index.js:23:227)
    at Te (/Users/xxxx/.vscode/extensions/salesforce.salesforcedx-vscode-lwc-58.14.2/dist/index.js:22:12217)
    at Immediate.<anonymous> (/Users/xxxx/.vscode/extensions/salesforce.salesforcedx-vscode-lwc-58.14.2/dist/index.js:22:12068)
    at processImmediate (node:internal/timers:476:21)

Previous warnings exist which may not be related:

2023-09-20 08:40:22.488 [warning] [redhat.vscode-xml] Accessing a resource scoped configuration without providing a resource is not expected. To get the effective value for '[xml]', provide the URI of a resource or 'null' for any resource.

bobalicious commented 1 year ago

Full extensions host output - in case it sheds any light:

2023-09-20 08:40:10.335 [info] Extension host with pid 55666 started
2023-09-20 08:40:10.335 [info] Skipping acquiring lock for /Users/xxxx/Library/Application Support/Code/User/workspaceStorage/0801f7ee385f2b392e3a2db3a4de4422.
2023-09-20 08:40:10.501 [info] ExtensionService#_doActivateExtension salesforce.salesforcedx-vscode-apex, startup: false, activationEvent: 'onLanguage:apex-anon'
2023-09-20 08:40:11.922 [warning] DiagnosticCollection with name 'apex-errors' does already exist.
2023-09-20 08:40:11.922 [warning] DiagnosticCollection with name 'apex-errors' does already exist.
2023-09-20 08:40:11.922 [warning] DiagnosticCollection with name 'apex-errors' does already exist.
2023-09-20 08:40:11.926 [info] ExtensionService#_doActivateExtension vscode.emmet, startup: false, activationEvent: 'onLanguage'
2023-09-20 08:40:11.944 [info] ExtensionService#_doActivateExtension vscode.git-base, startup: true, activationEvent: '*', root cause: vscode.git
2023-09-20 08:40:11.946 [info] ExtensionService#_doActivateExtension chuckjonas.apex-pmd, startup: true, activationEvent: '*'
2023-09-20 08:40:11.949 [info] ExtensionService#_doActivateExtension vscode.npm, startup: true, activationEvent: 'workspaceContains:package.json'
2023-09-20 08:40:11.984 [info] ExtensionService#_doActivateExtension salesforce.salesforcedx-vscode-core, startup: true, activationEvent: 'workspaceContains:sfdx-project.json', root cause: salesforce.salesforcedx-einstein-gpt
2023-09-20 08:40:14.019 [info] ExtensionService#_doActivateExtension salesforce.salesforcedx-vscode-lightning, startup: true, activationEvent: 'workspaceContains:sfdx-project.json'
2023-09-20 08:40:15.088 [info] ExtensionService#_doActivateExtension dbaeumer.vscode-eslint, startup: true, activationEvent: 'workspaceContains:sfdx-project.json', root cause: salesforce.salesforcedx-vscode-lwc
2023-09-20 08:40:15.650 [info] ExtensionService#_doActivateExtension salesforce.salesforcedx-vscode-soql, startup: true, activationEvent: 'workspaceContains:sfdx-project.json'
2023-09-20 08:40:16.666 [info] ExtensionService#_doActivateExtension vscode.github-authentication, startup: false, activationEvent: 'onAuthenticationRequest:github'
2023-09-20 08:40:16.673 [info] ExtensionService#_doActivateExtension vscode.git, startup: true, activationEvent: '*'
2023-09-20 08:40:16.688 [info] ExtensionService#_doActivateExtension vscode.github, startup: true, activationEvent: '*'
2023-09-20 08:40:16.695 [info] ExtensionService#_doActivateExtension salesforce.salesforcedx-vscode-lwc, startup: true, activationEvent: 'workspaceContains:sfdx-project.json'
2023-09-20 08:40:18.273 [info] ExtensionService#_doActivateExtension redhat.vscode-xml, startup: false, activationEvent: 'api', root cause: salesforce.salesforcedx-vscode-lwc
2023-09-20 08:40:18.433 [info] ExtensionService#_doActivateExtension vscode.microsoft-authentication, startup: false, activationEvent: 'onAuthenticationRequest:microsoft'
2023-09-20 08:40:19.855 [info] ExtensionService#_doActivateExtension salesforce.salesforcedx-einstein-gpt, startup: true, activationEvent: 'workspaceContains:sfdx-project.json'
2023-09-20 08:40:20.010 [info] ExtensionService#_doActivateExtension salesforce.salesforcedx-vscode-visualforce, startup: true, activationEvent: 'workspaceContains:sfdx-project.json'
2023-09-20 08:40:20.014 [info] ExtensionService#_doActivateExtension salesforce.salesforcedx-vscode-apex-debugger, startup: true, activationEvent: 'workspaceContains:sfdx-project.json'
2023-09-20 08:40:20.958 [info] ExtensionService#_doActivateExtension salesforce.salesforcedx-vscode-apex-replay-debugger, startup: true, activationEvent: 'workspaceContains:sfdx-project.json'
2023-09-20 08:40:22.252 [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch, startup: false, activationEvent: 'onStartupFinished'
2023-09-20 08:40:22.254 [info] ExtensionService#_doActivateExtension vscode.merge-conflict, startup: false, activationEvent: 'onStartupFinished'
2023-09-20 08:40:22.259 [info] ExtensionService#_doActivateExtension eamodio.gitlens, startup: false, activationEvent: 'onStartupFinished'
2023-09-20 08:40:22.283 [info] ExtensionService#_doActivateExtension esbenp.prettier-vscode, startup: false, activationEvent: 'onStartupFinished'
2023-09-20 08:40:22.301 [info] ExtensionService#_doActivateExtension GitHub.copilot, startup: false, activationEvent: 'onStartupFinished'
2023-09-20 08:40:22.338 [info] ExtensionService#_doActivateExtension GitHub.copilot-labs, startup: false, activationEvent: 'onStartupFinished'
2023-09-20 08:40:22.428 [info] ExtensionService#_doActivateExtension shardulm94.trailing-spaces, startup: false, activationEvent: 'onStartupFinished'
2023-09-20 08:40:22.476 [warning] [redhat.vscode-xml] Accessing a resource scoped configuration without providing a resource is not expected. To get the effective value for '[xml]', provide the URI of a resource or 'null' for any resource.
2023-09-20 08:40:22.480 [warning] [redhat.vscode-xml] Accessing a resource scoped configuration without providing a resource is not expected. To get the effective value for '[xml]', provide the URI of a resource or 'null' for any resource.
2023-09-20 08:40:22.488 [warning] [redhat.vscode-xml] Accessing a resource scoped configuration without providing a resource is not expected. To get the effective value for '[xml]', provide the URI of a resource or 'null' for any resource.
2023-09-20 08:40:23.417 [info] ExtensionService#_doActivateExtension ms-vsliveshare.vsliveshare, startup: false, activationEvent: 'api', root cause: eamodio.gitlens
2023-09-20 08:40:23.500 [error] Error: Request initialize failed with message: Cannot read properties of undefined (reading 'location')
    at be (/Users/xxxx/.vscode/extensions/salesforce.salesforcedx-vscode-lwc-58.14.2/dist/index.js:23:227)
    at Te (/Users/xxxx/.vscode/extensions/salesforce.salesforcedx-vscode-lwc-58.14.2/dist/index.js:22:12217)
    at Immediate.<anonymous> (/Users/xxxx/.vscode/extensions/salesforce.salesforcedx-vscode-lwc-58.14.2/dist/index.js:22:12068)
    at processImmediate (node:internal/timers:476:21)
2023-09-20 08:40:25.809 [info] Eager extensions activated
pavan00089 commented 1 year ago

Even I am also experiencing the same issue.

Below steps I have followed but still I see the error.

  1. I have updated vs code to latest version.
  2. Updated sfdx to latest version
  3. Uninstalled the extension pack and re-installed again.
  4. Updated Jdk to latest version.

VS_Error

WuggyX2 commented 1 year ago

@CristiCanizales We are having this issue also. I was able to reproduce this issue in a freshly generated project. The extension crashes when there is another javascript file in a LWC component that references window.location. There might be other APIs that cause the language server to crash, not just window.location.

Steps to reproduce:

  1. Generate a new sf project with cli.
  2. Create new LWC -component. Everything should work fine like referencing window.location
  3. Create a new JS file into the lwc component created in the previous step.
  4. create some code that references something in window.location like window.location.href. LWC extension should now crash.
  5. Reload window -> language server crashes on launch.

Language server output

TypeError: Cannot read properties of undefined (reading 'location')
    at mapLwcMetadataToInternal (/Users/.../.vscode/extensions/salesforce.salesforcedx-vscode-lwc-58.14.2/node_modules/@salesforce/lwc-language-server/lib/javascript/type-mapping.js:428:188)
    at compileSource (/Users/..../.vscode/extensions/salesforce.salesforcedx-vscode-lwc-58.14.2/node_modules/@salesforce/lwc-language-server/lib/javascript/compiler.js:172:66)
    at compileDocument (/Users/.../.vscode/extensions/salesforce.salesforcedx-vscode-lwc-58.14.2/node_modules/@salesforce/lwc-language-server/lib/javascript/compiler.js:184:12)
    at Server.onDidChangeContent (/Users/.../.vscode/extensions/salesforce.salesforcedx-vscode-lwc-58.14.2/node_modules/@salesforce/lwc-language-server/lib/lwc-server.js:195:84)

Node.js v18.15.0
[Info  - 22:33:22] Connection to server got closed. Server will restart.
/Users/.../.vscode/extensions/salesforce.salesforcedx-vscode-lwc-58.14.2/node_modules/@salesforce/lwc-language-server/lib/javascript/type-mapping.js:428
    const declarationLoc = externalToInternalLoc((_a = defaultExport === null || defaultExport === void 0 ? void 0 : defaultExport.location) !== null && _a !== void 0 ? _a : mainClassObj.location);
                                                                                                                                                                                           ^

TypeError: Cannot read properties of undefined (reading 'location')
    at mapLwcMetadataToInternal (/Users/.../.vscode/extensions/salesforce.salesforcedx-vscode-lwc-58.14.2/node_modules/@salesforce/lwc-language-server/lib/javascript/type-mapping.js:428:188)
    at compileSource (/Users/..../.vscode/extensions/salesforce.salesforcedx-vscode-lwc-58.14.2/node_modules/@salesforce/lwc-language-server/lib/javascript/compiler.js:172:66)
    at compileDocument (/Users/..../.vscode/extensions/salesforce.salesforcedx-vscode-lwc-58.14.2/node_modules/@salesforce/lwc-language-server/lib/javascript/compiler.js:184:12)
    at Server.onDidChangeContent (/Users/.../.vscode/extensions/salesforce.salesforcedx-vscode-lwc-58.14.2/node_modules/@salesforce/lwc-language-server/lib/lwc-server.js:195:84)

Node.js v18.15.0
[Error - 22:33:23] Connection to server got closed. Server will not be restarted.

Edited: Typos...

OS: macOs 13.5.2 (22G91) extension version: v58.14.2

bobalicious commented 12 months ago

Following @WuggyX2 's post, commented out all references to window. and location in a codebase does not resolve the issue. It may be a trigger for the error, but it appears to not be the only one.

Also, creating an empty additional JS file anywhere in the lwc folder causes the following:

/Users/xxxx/.vscode/extensions/salesforce.salesforcedx-vscode-lwc-58.14.2/node_modules/@salesforce/lwc-language-server/lib/javascript/type-mapping.js:428
    const declarationLoc = externalToInternalLoc((_a = defaultExport === null || defaultExport === void 0 ? void 0 : defaultExport.location) !== null && _a !== void 0 ? _a : mainClassObj.location);
                                                                                                                                                                                           ^

TypeError: Cannot read properties of undefined (reading 'location')
    at mapLwcMetadataToInternal (/Users/xxxx/.vscode/extensions/salesforce.salesforcedx-vscode-lwc-58.14.2/node_modules/@salesforce/lwc-language-server/lib/javascript/type-mapping.js:428:188)
    at compileSource (/Users/xxxx/.vscode/extensions/salesforce.salesforcedx-vscode-lwc-58.14.2/node_modules/@salesforce/lwc-language-server/lib/javascript/compiler.js:172:66)
    at compileDocument (/Users/xxxx/.vscode/extensions/salesforce.salesforcedx-vscode-lwc-58.14.2/node_modules/@salesforce/lwc-language-server/lib/javascript/compiler.js:184:12)
    at Server.onDidChangeContent (/Users/xxxx/.vscode/extensions/salesforce.salesforcedx-vscode-lwc-58.14.2/node_modules/@salesforce/lwc-language-server/lib/lwc-server.js:195:84)`
bobalicious commented 12 months ago

Also, if I create a headless LWC I get an issue.

  1. Start with empty project
  2. Create LWC 'LayoutConstants'
  3. Replace JS contents with:
const DISPLAY_DENSITY = Object.freeze({
    COMFY   : 'comfy',
    COMPACT : 'compact',
    DEFAULT : 'comfy',
});

const getKeyForDisplayDensity = displayDensity => {
    for ( let key in DISPLAY_DENSITY ) {
        if ( DISPLAY_DENSITY[ key ] === displayDensity ) {
            return key;
        }
    }
    return '';
}

const LABEL_PROPERTIES = Object.freeze({
    COMFY   : {
        VARIANT : 'standard',
        CLASSES : 'slds-form-element slds-form-element_stacked'
    },
    COMPACT : {
        VARIANT : 'label-inline',
        CLASSES : 'slds-form-element slds-form-element_horizontal'
    },
    HIDDEN : {
        VARIANT : 'label-hidden',
        CLASSES : ''
    },
});

const CONSTANTS = Object.freeze({
    DISPLAY_DENSITY  : DISPLAY_DENSITY,
    LABEL_PROPERTIES : LABEL_PROPERTIES,
    getLabelVariant  : displayDensity => LABEL_PROPERTIES[ getKeyForDisplayDensity( displayDensity ) ].VARIANT,
    getLabelClasses  : displayDensity => LABEL_PROPERTIES[ getKeyForDisplayDensity( displayDensity ) ].CLASSES
});

export default CONSTANTS;

Immediate crash before save:

/Users/xxxx/.vscode/extensions/salesforce.salesforcedx-vscode-lwc-58.14.2/node_modules/@salesforce/lwc-language-server/lib/javascript/type-mapping.js:373
    methodLocs, } = getDecoratedMethods(classObj.methods);
                                                 ^
TypeError: Cannot read properties of undefined (reading 'methods')
    at getDecorators (/Users/xxxx/.vscode/extensions/salesforce.salesforcedx-vscode-lwc-58.14.2/node_modules/@salesforce/lwc-language-server/lib/javascript/type-mapping.js:373:50)
    at mapLwcMetadataToInternal (/Users/xxxx/.vscode/extensions/salesforce.salesforcedx-vscode-lwc-58.14.2/node_modules/@salesforce/lwc-language-server/lib/javascript/type-mapping.js:430:21)
    at compileSource (/Users/xxxx/.vscode/extensions/salesforce.salesforcedx-vscode-lwc-58.14.2/node_modules/@salesforce/lwc-language-server/lib/javascript/compiler.js:172:66)
    at compileDocument (/Users/xxxx/.vscode/extensions/salesforce.salesforcedx-vscode-lwc-58.14.2/node_modules/@salesforce/lwc-language-server/lib/javascript/compiler.js:184:12)
    at Server.onDidChangeContent (/Users/xxxx/.vscode/extensions/salesforce.salesforcedx-vscode-lwc-58.14.2/node_modules/@salesforce/lwc-language-server/lib/lwc-server.js:195:84)

I suspect that these are all related to the fact that the LWC language server is very strict about the shape of LWC it expects and doesn't handle LWCs that are actually modules, or have additional JS files in them.

WuggyX2 commented 12 months ago

4994 Error messages in this issue seem to be similar that we are having.

gianlucaghezzi24 commented 12 months ago

I've updated the Lightning Web Components extension to version v58.15.0 but the error is still there

CristiCanizales commented 11 months ago

Hello everyone, could you please try installing the vsixes at the bottom of this page, restart vscode and check if the issue persists?

To install vsixes you need to go to the extensions view, click the 3 dots in the action menu, select Install from vsixes and select them:

image

juanjetomas commented 11 months ago

@CristiCanizales after updating the LWC extension from the VSIX the error stopped popping. I wasn't able to install all of them because there were some installation errors.

CristiCanizales commented 11 months ago

Hi @salesforceDev-role, @KevinLaurence, @JsalvaJ, @gianlucaghezzi24, @SalesforceAlexS, @rob-baillie-ortoo, @bobalicious, @pavan00089, @WuggyX2! Could you all please do the same (install VSIX for salesforce.salesforcedx-vscode-lwc extension which you can find at the bottom of this page, restart vscode and check if the issue persists)? Thanks in advance!

KevinLaurence commented 11 months ago

Hi @salesforceDev-role, @KevinLaurence, @JsalvaJ, @gianlucaghezzi24, @SalesforceAlexS, @rob-baillie-ortoo, @bobalicious, @pavan00089, @WuggyX2! Could you all please do the same (install VSIX for salesforce.salesforcedx-vscode-lwc extension which you can find at the bottom of this page, restart vscode and check if the issue persists)? Thanks in advance!

I cannot download the file. Don't know why.

salesforceProDev commented 11 months ago

Hello @CristiCanizales, I did try as you asked to download the mentioned extension file and install it. It seems to be working as expected, I am not getting that failed to initialize message anymore👍. But will it be resolved with the upcoming versions of the extensions? Happy Friday

CristiCanizales commented 11 months ago

Hello @salesforceDev-role, great! And yes, of course! It will go out in our next release (next wednesday/thursday). Thanks for your patience all this time and sorry for the inconveniences. Happy friday!

CristiCanizales commented 11 months ago

@KevinLaurence Here's the .zip file for salesforcedx-vscode-lwc-58.15.0.zip. Just change the extension to .vsix and try installing it.

salesforceProDev commented 11 months ago

@CristiCanizales, Thanks for all your help, appreciate it.

WuggyX2 commented 11 months ago

@CristiCanizales I also tested the updated extension and can confirm that the language server no longer crashes when there are additional JS modules in a same file.

CristiCanizales commented 11 months ago

Closing this issue after confirmation from different users that the fix works. Thanks @divmain for the fix! 🥳

pavan00089 commented 11 months ago

@CristiCanizales Help me out here If I am doing something wrong.

1) I download the zip from the link then extracted it.

2) Then I renamed extension.vsixmanifest file to extension.vsixmanifest.vsix.

3) Then I tried to Install that manually but getting below error.

Error

JsalvaJ commented 11 months ago

Hello @CristiCanizales it seems that it works good. I don't have the issue when VS starts. Thanks a lot!

KevinLaurence commented 11 months ago

Thanks @CristiCanizales I can confirm that the latest version of the extension installed in VS Code successfully.

bobalicious commented 11 months ago

@CristiCanizales - Sorry, I've not been able to install the upgrade linked from this issue - has this fix gone into the latest versions yet? I see a new version was released yesterday.

If so, the problem still occurs for me.

bobalicious commented 11 months ago

Running version 58.16.0

Errors in extension host:

2023-10-06 10:36:36.972 [error] Error: Request initialize failed with message: Cannot read properties of undefined (reading 'location')
    at be (/Users/xxxx/.vscode/extensions/salesforce.salesforcedx-vscode-lwc-58.16.0/dist/index.js:23:227)
    at Te (/Users/xxxx/.vscode/extensions/salesforce.salesforcedx-vscode-lwc-58.16.0/dist/index.js:22:12217)
    at Immediate.<anonymous> (/Users/xxxx/.vscode/extensions/salesforce.salesforcedx-vscode-lwc-58.16.0/dist/index.js:22:12068)
    at processImmediate (node:internal/timers:476:21)
Razvan-Racolta commented 11 months ago

I have the same issue. I downloaded the .zip file for salesforcedx-vscode-lwc-58.15.0.zip, renamed the extension to vsix, installed it and after vs code restart, the error is still there. After extension update, the issue is still there.

Should this issue be reopened?

Thank you kindly @CristiCanizales

github-actions[bot] commented 11 months ago

This issue has not received a response in 7 days. It will auto-close in 7 days unless a response is posted.

JsalvaJ commented 11 months ago

Hello, I'm continuing having the same issue. I installed the last version v59 and the same message is fired for me.

mainThreadExtensionService.ts:81 [salesforce.salesforcedx-vscode-lwc]Request initialize failed with message: Cannot read properties of undefined (reading 'location') $onExtensionRuntimeError @ mainThreadExtensionService.ts:81 mainThreadExtensionService.ts:82 Error: Request initialize failed with message: Cannot read properties of undefined (reading 'location') at be (.vscode\extensions\salesforce.salesforcedx-vscode-lwc-59.0.0\dist\index.js:23:227) at Te (.vscode\extensions\salesforce.salesforcedx-vscode-lwc-59.0.0\dist\index.js:22:12217) at Immediate. (.vscode\extensions\salesforce.salesforcedx-vscode-lwc-59.0.0\dist\index.js:22:12068) at process.processImmediate (node:internal/timers:476:21)

@CristiCanizales this is solved for everyone? I tried it few days ago and it seems that works good but not...