SalesforceWizard

LWC debugging interview questions

Debugging questions show whether you have actually shipped components. These cover the tools and the usual suspects when an LWC does not behave.

0 of 10 reviewed
On this page (6 sections)Interview questionsCommon MistakesRelated LWC Debugging Interview QuestionsFrequently Asked Questions about LWC Debugging InterviewsRelated CertificationsRelated Resources

Production LWC bugs aren't caught by tests: they're caught by knowing which DevTools tab to open. These questions test whether you've actually shipped LWCs to production and seen things go sideways.

01

How do you debug an LWC in production?

Enable Debug Mode in Setup → Debug Mode for the user. Open browser DevTools → Sources, find the component under c/componentName.js, set breakpoints, refresh. Without Debug Mode the code is minified and unreadable.

02

What is Debug Mode in Salesforce?

A user-level setting that loads non-minified LWC and Aura code into the browser. Slows down the page significantly, so enable only for debugging users: never org-wide in production.

03

How do you debug a wire that returns no data?

Check { data, error } in your callback. Log both. Verify reactive parameter is defined (wire holds while $param is undefined). Verify @AuraEnabled cacheable=true is set on the Apex method. Check user's FLS/CRUD on the queried fields.

04

Component renders but no data: where do you start?

Console.log inside connectedCallback to confirm Apex returned data. If it did, log this.template.querySelector results to see if the DOM actually has elements. Many 'no data' bugs are template binding mistakes (wrong property name).

05

How do you handle uncaught errors in LWC?

Wrap async code in try/catch. For sync render errors use errorCallback on a parent component to show fallback UI. Log errors via Apex to a custom log object so production issues are visible.

06

Why doesn't my @track work?

Since Spring '20, all class properties are reactive by default. @track is only needed for deep mutation of objects/arrays. If updating an array element doesn't trigger render, replace the whole array (this.list = [...this.list]).

07

How do you debug LMS messages?

Console.log on publish and subscribe sides. Check that both components import the same Message Channel reference. Verify the page is the same: LMS doesn't cross pages.

08

How do you find which component is slow?

Use Chrome Performance tab, record while interacting. LWC component render times appear under their tag name. For network slowness, check Network tab for slow Apex calls, usually the culprit.

09

How do you debug LWC on Salesforce Mobile?

Use remote debugging: Chrome DevTools for Android, Safari DevTools for iOS. Connect device, open the app, navigate to your component. Console and breakpoints work the same.

10

What's your go-to debugging checklist?

  • Debug Mode on.
  • Console open.
  • Check Apex returns expected JSON.
  • Check wire { data, error } both.
  • Confirm reactive params defined.
  • Inspect DOM for actual rendered markup.
  • Check FLS for the running user.

Common Mistakes

Debugging without Debug Mode on. Code is minified and useless.

Ignoring the error path on @wire. Component looks broken but error is sitting there.

Not checking FLS. Profile differences cause prod-only issues.

Frequently Asked Questions about LWC Debugging Interviews

Can I use console.log in production?

Yes but they're hidden when Debug Mode is off. Better to log critical errors via Apex to a custom log object.

Does Lightning Inspector still work?

Yes, the Salesforce Lightning Inspector Chrome extension still works for both Aura and LWC inspection.

How do I see Apex errors thrown to LWC?

Catch the rejected promise: error.body.message contains the Apex exception message.

Can I unit test LWC?

Yes, with @lwc/jest: runs in Node, mocks Salesforce modules and Apex calls.

Why does my component break only in some browsers?

LWC supports modern browsers; old browsers (IE) aren't supported. Polyfill issues are rare in 2026.

JavaScript Developer I and PD2. See certification guides.

Chat on WhatsApp