-6

I am working on wire service, I get the output on UI (salesforce UI), I want to be able to see the response data in the dev console so that I manipulate the data on template.

Usualy we should be able to see the component in the console. I cannot see my component there. What settings do I enable

1
  • 1
    Have you looked in the correct javascript source path folder to find the compiled LWC code for your component in the browser inspector? When looking, are you sure your component has been loaded into the page (can you see it)?
    – Phil W
    Nov 21, 2021 at 10:26

1 Answer 1

-2

please make sure that you have added console.log() wherever needed inside the component. Wire service provisions data as an immutable stream of key value pairs, which you access as:

 @wire (accounts, {recordId:recordId})
    fetchAccount({error, data}){
        if(data){
          //HERE YOU RECIEVE THE DATA
            console.log(data);
        }else if(error){
            console.log(error);
        }
    };

That's a quick way. But if you want to go ahead for clean debugging, better to put breakpoints in the line and observe that for error in the output/dev console.

I can see wireDemoUserDetail.js in console, is that your component?"

Also, I would encourage you to go ahead and read the guidelines for asking a question, Phil knows it better than me. If possible, please provide a snippet of your code here using the editor instead of screenshots.

7
  • Dweepayan Sharma, no that is not my component. The picture above that is my component. Let me add console.log(). Nov 21, 2021 at 13:33
  • Hi can you check if you have 'hidden(eye icon)' checked in dev console? I will be helping you out in this, If needed, then you can share a snapshot of your entire code as well! Nov 21, 2021 at 15:22
  • 5
    Please don't encourage use of screenshots to share code - it is unsearchable and also makes it much harder to suggest code changes.
    – Phil W
    Nov 21, 2021 at 16:53
  • Agreed, by snapshot I meant a glimpse of the entire code, maybe repos like git or fiddle...or a copy paste in code console. You have raised an excellent point, no doubt. Nov 21, 2021 at 16:54
  • It is working now guys. Thank you. console.log(data) worked. Nov 21, 2021 at 17:38

Not the answer you're looking for? Browse other questions tagged .