Questions tagged [javascript-debugging]
The javascript-debugging tag has no summary.
35 questions
-1
votes
1
answer
71
views
data is not showing on UI screen what is error in my program plz ans if any know this what mistake i m doing in this
JS::
import { LightningElement,track, wire } from 'lwc';
import fetchPatientData from '@salesforce/apex/PatientData.fetchPatientData';
export default class SalesforceCommandFile extends ...
0
votes
1
answer
483
views
How can I Jest test an Lightning Web Componet which leverages `connectedCallback`?
I have a Lightning Web Component "dapUserList".
This is the HTML:
<template>
<lightning-card title="User List" icon-name="utility:user">
<c-...
2
votes
1
answer
131
views
User Name returning "null" at seemingly random instances
Okay this is a weird one. I have an aura component that I put on our user record pages that display that user's open opportunities. I pull the recordId from the URL, run SOQL to grab all open opps for ...
0
votes
1
answer
942
views
Issue with options in lightning-select from js
I am learning to build some basic lwc and I am struggling with dynamically putting lightning-select options from JS.
Here's the html:
<lightning-select
name="distribution-...
1
vote
1
answer
2k
views
ssjs System.Collections.Generic.Dictionary`2[System.String,System.Object]
I have a SSJS code that i am running SFMC cloudpages. The code is to do a HTTP.GET call to a url and then parse the JSON response.when trying to write out the result of parse i receive the following ...
0
votes
2
answers
673
views
Setter is not getting invoked ,Could anyone please help me understand the flow and how to get setter invoked?
Html File
<template>
<lightning-input label="Enter your First Name" onchange={captureFName}></lightning-input>
<lightning-input label="Enter your Last Name&...
1
vote
1
answer
567
views
How to avoid problem with debugging LWC Javascript?
Due to some recent changes, first:
Enabling by default Use Lightning Web Security for Lightning web components
Enable Stricter Content Security Policy
it becomes impossible to debug LWC Javascript ...
0
votes
2
answers
721
views
A conditionally executed single line should be denoted by indentation
In a javascript file, I get the indentation code quality error:
closeComp() {
const selectEvent = new CustomEvent('hidemodal', {
detail: true
});
this.dispatchEvent(selectEvent);
}
...
11
votes
2
answers
2k
views
Debug Components in an Org With LWS Enabled - breakpoints not working
The new Lightning Web Security model that is set to overtake Lightning Locker is not working the way the SF docs explain. In short: I do not have an 'lws' folder.
From developer.salesforce.com:
When ...
0
votes
1
answer
490
views
Javascript "getElementById" return null in Visualforce Page
Anyone help me, why Javascript "getElementById" return null in Visualforce Page.
In my form, I have "Radio button" and "inputtextarea"
My requirement is whenever click ...
0
votes
0
answers
584
views
Action failed: flexipage:runtimeComponent$controller$init [Headers is not a constructor]
I am trying to create a currency exchange app and anytime I deploy the code to my org via VS Code, I keep getting the error Action failed: flexipage:runtimeComponent$controller$init [Headers is not a ...
1
vote
1
answer
497
views
Salesforce LWC In ScreenFlow looks different in debug mode than in production
We are experiencing a weird issue with a LWC that is imbedded into a Screenflow Login flow. When we debug the flow in flowbuilder, the css is perfectly structured and the LWC signup form component ...
0
votes
1
answer
802
views
LWC: How to add integer value into an array in JS controller which is bound to the data property of lightning datatable
Let's consider the below scenario:
I have a scenario to bind integer value which is calculated from apex function. I have to display integer value in lightning datatable column.
Please find the code ...
6
votes
4
answers
9k
views
Facing issue in debugging LWC Javascript with Chrome DevTools
I am trying to debug LWC JavaScript using Chrome's DevTools. However I am unable to see /modules/c component under sources tab of Chrome DevTools. The same is working fine for other sandbox. Does ...
0
votes
1
answer
2k
views
LWC [object Object] returns undefined when trying to access property values
I have data returned from apex as a string:
[{"Rank":1,"Points":61,"Name":"Susan Johanson","Id":"0038d00000ANPt7AAH"},{"Rank":2,&...
2
votes
0
answers
132
views
amcharts index.js is rejected by loadScript() in LWC with empty exception
We tried to include amcharts5 libraries - index.js, animated.js and xy.js in LWC. Animated.js and xy.js is loaded properly in LWC but index.js is failing with an empty exception and it goes inside the ...
2
votes
1
answer
4k
views
Type error in LWC cannot read properties of null - the log is showing the data
I have a LWC that I am debugging(did not write it myself). Its showing 'Type error in LWC cannot read properties of null' yet when i print to the console i can see the data. What else could be the ...
2
votes
1
answer
1k
views
How to reset values of a multiselect combo box on click of a button in LWC
In my parent component I'm calling child component as:
<c-multiselect-picklist multi-picklist-values={picklistValues} onselect={handleChange}
preselected-string={selectedPicklistValue} data-id=&...
0
votes
1
answer
632
views
How do I turn this array into one array in LWC? [closed]
ExampleArray = [["Relationship", "Subscriber"],
["memberId", "12345"],
["MemberName", "Test Member"]]
How would I turn the above into just ...
1
vote
3
answers
2k
views
Enable Lightning Components "debug mode" for a guest user
Is it possible to turn on Debug Mode for Lightning Components for a guest/anonymous/not signed in user?
When I go to Setup -> Custom Code -> Lightning Components -> Debug Mode, I cannot see ...
1
vote
1
answer
873
views
Sorting the List in Javascript [closed]
@api weekdaySelectionData=[];
The below is coming through data table, but I just want to sort the final list:
weekdaySelectionData=[{"Day__c":"Tue","Morning__c":true,&...
0
votes
1
answer
542
views
What is the meaning of a>>>0 in javascript? where a is an integer variable holding a value in js [closed]
I tried to do a small poc to understand this in detail like .
var a = -1;
a>>>0;
var a = 0;
a>>>0.
I know this is right shift zero fill binary operator but what does >>>0 ...
0
votes
1
answer
461
views
Dymanic add Row in LWC and updating the value before push
i have a JSON Object which has Parent Details, In my page i have an option to add New Row dynamically when i click on + button.
[
{
"canRepeat": true,
"dynamicName&...
3
votes
0
answers
1k
views
window.addEventListener("message") not working in salesforce mobile app
I have an Aura component that opens a canvas app.
The canvas app communicates with the Aura component using window.postMessage.
In my Aura component during init, I am adding a listener for postMessage....
0
votes
2
answers
4k
views
Unexpected token error in If statement in LWC Javascript controller
This is a basic javascript question.
FYI the context is: It is in a Javascript controller for a Salesforce Lightning Web Component, editing in Visual Studio. The code is for selecting a set of table ...
0
votes
0
answers
4k
views
Callback failed Error for Lightning Aura Component
I am facing the below error for the Lightning component. I tried to debug but was not able to find the root cause.
This page has an error. You might just need to refresh it.
Error in $A.getCallback() ...
3
votes
1
answer
1k
views
Salesforce lightning inspector chrome extension not found [closed]
Tried to install Google chrome extension Salesforce Lightning Inspector but it takes me to 404 page which means that there is no extension literally not available to install. Is there a way to get ...
0
votes
1
answer
344
views
SOQL query on related records in Javascript(Visualforce page)
I have written below query in Javascript(Visualforce page) and trying to access query result as shown below, but it is failing at second console log and giving error in developer console.
var ...
0
votes
1
answer
2k
views
In JS of LWC, line after forEach statement does not execute
I have below Javascript function in lwc
apexJobInfoData;
@track isBatch;
getData({ error, data }) {
if (error) {
// TODO: handle error
} else if (data) {
this.jobId = ...
0
votes
2
answers
97
views
Javascript validation check not working
I am trying to check javascript validations on some fields in visualforce page. Following is my code.
<apex:page >
<html>
<head>
<script>
...
3
votes
1
answer
8k
views
LWC constructor() error: "Must call super constructor in derived class before accessing 'this' or returning from derived constructor"
I'm getting the following error:
Must call super constructor in derived class before accessing 'this' or returning from derived constructor
after adding a very simple test constructor to my LWC
...
1
vote
0
answers
91
views
Visualforce <Apex:tabpanel> breaks MathJax (math formating script)
Problem:
I am using mathjax to format math equations nicely on a visualforce page.
Everything goes great on a naked vf page.
<apex:page >
<!--script id="MathJax-script" src="https://cdn....
4
votes
1
answer
308
views
How to use polyfill in visualforce component?
Link to polyfill: https://github.com/jonstipe/number-polyfill
The polyfill is to allow increment decrement buttons in Internet explorer for
I added the .js and .css file from the polyfill as a ...
1
vote
1
answer
65
views
Unable to setup custom javascript detail page button
I am working on detail javascript button in the lead object. But now I am facing the below issue.
Javascript code:
{!REQUIRESCRIPT("/soap/ajax/30.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/24.0/...
1
vote
0
answers
128
views
LEX becomes unresponsive when debugging (adding breakpoints) to loaded static resources
Using Chrome - Version 72.0.3626.121
I often find myself integrating 3rd party libraries and while attempting to do so in LWC's errors are not uncommon, so, I check the errors and using the browsers ...