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

LWC language server errors #2570

Closed
freddie1729 opened this issue Sep 24, 2020 · 5 comments
Closed

LWC language server errors #2570

freddie1729 opened this issue Sep 24, 2020 · 5 comments

Comments

@freddie1729
Copy link

Summary

An error is thrown in the Output section of VS Code when editing a .js file.

[Error - 12:13:16] Request textDocument/definition failed. Message: Request textDocument/definition failed with message: Cannot destructure property 'delimiter' of '(intermediate value)(intermediate value)(intermediate value)' as it is undefined. Code: -32603

Steps To Reproduce:

  1. Install Salesforce Extension Pack
  2. Go to an Aura Component
  3. Edit the .js files
  4. See this error in the Output:

[Error - 12:13:16] Request textDocument/definition failed.
Message: Request textDocument/definition failed with message: Cannot destructure property 'delimiter' of '(intermediate value)(intermediate value)(intermediate value)' as it is undefined.
Code: -32603

Expected result

Describe what should have happened.

Actual result

Describe what actually happened instead.

Additional information

Feel free to attach a screenshot.

VS Code Version:

SFDX CLI Version:

OS and version:

@lcampos
Copy link
Contributor

lcampos commented Sep 29, 2020

Hi @freddie1729 thanks for opening this issue. I haven't been able to replicate this on our side, can you share the component you are using to run into this error or a sample project that consistently replicate this ?

@no-response
Copy link

no-response bot commented Oct 6, 2020

This issue has been automatically closed because there has been no response to our request for more information from the original author. Currently, there is not enough information provided for us to take action. Please reply and reopen this issue if you need additional assistance.

@no-response no-response bot closed this as completed Oct 6, 2020
@freddie1729
Copy link
Author

freddie1729 commented Nov 6, 2020

Here is the js code that is causing it:

import { LightningElement, wire } from 'lwc';
import areRecordTypesBeingUsed from '@salesforce/apex/GISMetadataUpdateConfigCont.areRecordTypesBeingUsed';
import getExistingMetadataUpdateSettings from '@salesforce/apex/GISMetadataUpdateConfigCont.getExistingMetadataUpdateSettings';
import deleteSetting from '@salesforce/apex/GISMetadataUpdateConfigCont.deleteSetting';
import getAvailableGisObjects from '@salesforce/apex/GISMetadataUpdateConfigCont.getAvailableGisObjects';
import insertSetting from '@salesforce/apex/GISMetadataUpdateConfigCont.insertSetting';
import { refreshApex } from '@salesforce/apex';

const actions = [
{ label: 'Delete', name: 'delete' }
];

//TODO: get rid
const columns = [
{ label: 'Name', fieldName: 'objectName', hideDefaultActions: true },
{
iconName: 'utility:delete',
type: 'action',
typeAttributes: { rowActions: actions },
}
];

export default class GisMetadataUpdateConfig extends LightningElement {
columns = columns;
record = {};
showWarning = false;
selectedObject = '';
metadataUpdateSettings;
settings = [];

@wire(getExistingMetadataUpdateSettings)
handleMetadataUpdateSettings(response) {
    if(response.data) {
        this.metadataUpdateSettings = response.data;
        for(let i = 0; i < response.data.length; i++) {
            const setting = response.data[i];
            this.settings.push({
                id : setting.settingId,
                objectName : setting.objectName,
                handleDelete : event => {
                    const id = event.target.dataset.id;
                    this.deleteSetting(id);
                }
            });
            this.settings = settings;
        }
    }
}


@wire(getAvailableGisObjects)
options;

@wire(areRecordTypesBeingUsed)
showWarning;

handleRowAction(event) {
    const actionName = event.detail.action.name;
    const row = event.detail.row;
    switch (actionName) {
        case 'delete':
            this.deleteRow(row);
            break;
        default:
    }
}

deleteSetting(settingId) {
    deleteSetting({ 
        settingId : settingId 
    }).then((result) => {
        this.refreshSettingList();
        this.refreshObjectOptions();
    }).catch((error) => {
        console.error(error);
    });
}

// deleteRow(row) {
//     deleteSetting({ 
//         settingId : row.settingId 
//     }).then((result) => {
//         this.refreshSettingList();
//         this.refreshObjectOptions();
//     }).catch((error) => {
//         console.error(error);
//     });
// }

handleAdd(event) {
    var objectName = this.selectedObject;
    insertSetting({
        objectName : objectName
    }).then((result) => {
        this.refreshSettingList();
        this.refreshObjectOptions();
        this.selectedObject = '';
    })
    .catch((error) => {
        console.error(error);
    });
}

handleObjectChange(event) {
    this.selectedObject = event.detail.value;
}

refreshSettingList() {
    refreshApex(this.metadataUpdateSettings);
}

refreshObjectOptions() {
    refreshApex(this.options);
}

get disableAddButton(){
    return this.selectedObject === '';
}

}

@freddie1729
Copy link
Author

It is happening on both LWC and Aura

@lcampos
Copy link
Contributor

lcampos commented Dec 3, 2020

Thanks for providing feedback @freddie1729 , I'm closing this now since the fix is available on v50.7.0.

@lcampos lcampos closed this as completed Dec 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants