{"id":190088,"date":"2019-02-11T12:00:51","date_gmt":"2019-02-11T19:00:51","guid":{"rendered":"http:\/\/developer.salesforce.com\/blogs\/?p=190088"},"modified":"2025-11-05T02:22:30","modified_gmt":"2025-11-05T09:22:30","slug":"debug-your-lightning-web-components","status":"publish","type":"post","link":"https:\/\/developer.salesforce.com\/blogs\/2019\/02\/debug-your-lightning-web-components","title":{"rendered":"Debug Your Lightning Web Components"},"content":{"rendered":"<p>You built your first Lightning web component, everything looks great in the IDE, but something is not working as expected in your Salesforce org. That&#8217;s the point where it&#8217;s important to know how you can debug Lightning web components. This blog post will show you the available techniques.<\/p>\n<h2>Lightning web components in production mode<\/h2>\n<p>Before we look into debugging, it&#8217;s important to understand how we serve Lightning Web Components to the browser in what we call production mode and what utilities you have at hand for them. That mode is what you experience out of the box when a user uses Salesforce. It provides you two things when it comes to Lightning Web Components:<\/p>\n<ul>\n<li>Minified JavaScript<\/li>\n<li>Proxied values<\/li>\n<\/ul>\n<p>While it&#8217;s not related to debugging, it&#8217;s also noteworthy that we ship heavy JavaScript transformations for older browsers, like IE11. That way you can use modern JavaScript and actually don&#8217;t have to care what browser your users are using.<\/p>\n<h3>Minified JavaScript<\/h3>\n<p>Minification means that we compress JavaScript into as few bytes as possible by removing any unnecessary characters and elements like line breaks, whitespace, tabs, code comments and so forth. This reduces the overall traffic that&#8217;s required for sending a file to a browser. Minifaction also changes the names of functions or variables, for example <code>const mySuperVariable<\/code> can become <code>const d<\/code> . Every Lightning Web Component JavaScript file that your browser receives from Salesforce in production mode is minified.<\/p>\n<p>Without any special setting, you can use the pretty format option in Chrome DevTools (or similar counterpart in your preferred browser) to get some sort of code formatting. This doesn&#8217;t give you full readability because of the changed names of variables and functions, but it&#8217;s pretty decent for a first check. This code is already debuggable, which means you can set breakpoints, inspect values during runtime, and use Chrome DevTools to work with the debugged values.<\/p>\n<p>\n\t\t\t  <span class=\"postimagessection_specify aligncenter\" >\n\t\t\t    <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/d259t2jj6zp7qm.cloudfront.net\/images\/v1549909394-minified_pretty_print_krzxhi.gif\" class=\"postimages\" width=\"1226\" height=\"738\" alt=\"\" \/>\n\t\t\t  <\/span>\n\t\t\t<\/p>\n<p>Note, that you see in the GIF already the location of custom Lightning web components in the <i>Source<\/i> tab &#8211; it&#8217;s <code>modules<\/code> (compared to <code>components<\/code> for Aura components).<\/p>\n<h3>Proxied values<\/h3>\n<p>Next, we proxy certain things, like data that is provisioned via decorators (@api, @track, @wire). Some of that is to be considered read-only, like @api and @wire decorated properties. By using <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Global_Objects\/Proxy\">JavaScript Proxies<\/a> we make sure that they stay read-only. And for @track decorated properties, we use proxies to observe data mutation. This also means that you only see the Proxy object and you either have to use something like <code>JSON.stringify()<\/code> in Chrome DevTools (note: if you have an Object with circular references, it&#8217;ll throw when stringified), or you have to inspect the object structure itself.<\/p>\n<p>\n\t\t\t  <span class=\"postimagessection_specify aligncenter\" >\n\t\t\t    <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/d259t2jj6zp7qm.cloudfront.net\/images\/c_scale%2Cw_800-proxied_values_zmcojq.png\" class=\"postimages\" width=\"800\" height=\"468\" alt=\"\" \/>\n\t\t\t  <\/span>\n\t\t\t<\/p>\n<p>Now, you already get <i>some<\/i> good debugging information in production mode. But what if you want the real cool stuff? Let&#8217;s take a look at that.<\/p>\n<h2>Lightning web components in debug mode<\/h2>\n<p>Besides production mode, you can enable debug mode for specific users. Debug mode gives you a few things, and particularly a few things that were not available previously for Aura components:<\/p>\n<ul>\n<li>Unminified JavaScript<\/li>\n<li>Custom formatting<\/li>\n<li>Developer mode console warnings<\/li>\n<\/ul>\n<p>You can read more about debug mode and how to enable it for users in the <a href=\"https:\/\/developer.salesforce.com\/docs\/component-library\/documentation\/lwc\/lwc.debug_mode_enable\">Lightning Web Components documentation<\/a>. You can also use Salesforce CLI to create a new user in a scratch org with debug mode enabled using this command:<\/p>\n<pre language=\"bash\">sfdx force:user:create -a mydebuguser UserPreferencesUserDebugModePref=true<\/pre>\n<p>More information on how to use the <code>force:user:create<\/code> command can be found <a href=\"https:\/\/developer.salesforce.com\/docs\/atlas.en-us.sfdx_cli_reference.meta\/sfdx_cli_reference\/cli_reference_force_user.htm\">in the documentation<\/a>.<\/p>\n<h3>Unminified JavaScript<\/h3>\n<p>Real exciting is that we ship unminified JavaScript in debug mode. What you get in the browser is what you coded (at least in JavaScript + CSS). The mapping from what&#8217;s in your IDE to browser is close to 1:1. That&#8217;s pretty cool, right? Especially in longer JavaScript classes you don&#8217;t have to guess, or remember, what variable <code>d<\/code> was again \u2014 you&#8217;ll now see the name as it lives in your source code. And you can debug it, like you can do with minified JavaScript.<\/p>\n<p>\n\t\t\t  <span class=\"postimagessection_specify aligncenter\" >\n\t\t\t    <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/d259t2jj6zp7qm.cloudfront.net\/images\/c_scale%2Cw_800-unminified_snefw6.png\" class=\"postimages\" width=\"800\" height=\"468\" alt=\"\" \/>\n\t\t\t  <\/span>\n\t\t\tNote that the JavaScript file in the browser also includes additional code, like transformed decorators or relative imports that got rolled up. Check out the video at the bottom to see more.<\/p>\n<p>A tip on debugging data that you receive via decorated properties (@api or @wire): if you bind the decorator to a property you won&#8217;t currently be able to debug it. In case you see some behavior that you need to debug, change the property to a function (for @wire) or to a setter (for @api). Then you can debug based on the deconstructed <code>data<\/code> and <code>error<\/code> property.<\/p>\n<h3>Custom formatting<\/h3>\n<p>As you recall from the previous section, we&#8217;re using JavaScript proxies to enforce that certain types of data are read-only. To simplify the readability for you, we&#8217;re shipping a custom formatter in debug mode for these proxies. That means you won&#8217;t see the proxy object in Chrome, but instead the real value. We&#8217;re basically unwrapping the visual aspect of the proxy (but it&#8217;s still proxied, so no chance to modify the data, ok?!).<\/p>\n<p>\n\t\t\t  <span class=\"postimagessection_specify aligncenter\" >\n\t\t\t    <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/d259t2jj6zp7qm.cloudfront.net\/images\/c_scale%2Cw_800-custom_formatter_aghy0l.png\" class=\"postimages\" width=\"800\" height=\"409\" alt=\"\" \/>\n\t\t\t  <\/span>\n\t\t\tCustom formatters aren&#8217;t enabled by default in Chrome, so you&#8217;ll need to set <i>Chrome DevTools =&gt; Settings =&gt; Enable custom formatters<\/i>.<\/p>\n<h3>Console engine warnings<\/h3>\n<p>The third feature we&#8217;re shipping for helping you to better debug your Lightning web components are \u201cLWC engine\u201d warnings. In debug mode the Lightning Web Components engine actually identifies bad patterns that are only detectable during runtime, and then prints them as console warnings.<\/p>\n<p>\n\t\t\t  <span class=\"postimagessection_specify aligncenter\" >\n\t\t\t    <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/d259t2jj6zp7qm.cloudfront.net\/images\/c_scale%2Cf_gif%2Cw_800-console_warnings_wzkn6r.gif\" class=\"postimages\" width=\"800\" height=\"467\" alt=\"\" \/>\n\t\t\t  <\/span>\n\t\t\t<\/p>\n<p>It&#8217;s a best practice to develop your Lightning web components in an org using debug mode. That way you see if your code can be even more improved while you develop.<\/p>\n<p>There&#8217;s one caveat at the time of this writing: you&#8217;ll likely see other console warnings from the LWC engine on the console, as we with the initial release don&#8217;t filter on your own namespace. Because of that, you see other warnings for things like base Lightning components. Also note that in the current version of the filter in Chrome DevTools has no effect on the logged warnings themselves. Some of the warning messages are also obsolete and will be removed soon, like <code>Property \u201cxyz\u201d of [object] <\/code>is set to a non-trackable object, which means changes into that object cannot be observed (meaning you don&#8217;t have to care about that at the moment). And yes, we&#8217;ll improve that in the next few months (#safeharbor).<\/p>\n<p>The best way to actually filter for only your own components is to remove the \u201cinfo\u201d log level which hides the stack traces.<\/p>\n<h2>Pausing on caught exceptions<\/h2>\n<p>This doesn&#8217;t mean that you should take a break when your code hits an exception (although sometimes it&#8217;s the right thing to do). This means that you can \u2014 and should \u2014 leverage the functionality in your browser to pause JavaScript execution when an error is caught.<\/p>\n<p>When having <a href=\"https:\/\/developers.google.com\/web\/updates\/2015\/05\/automatically-pause-on-any-exception\">this feature activated<\/a>, you&#8217;ll find yourself in the situation that your browser will also halt on any exceptions that are not caused by your own code, but by ours. In that case, we recommend that you make use of <a href=\"https:\/\/developer.chrome.com\/devtools\/docs\/blackboxing\">blackboxing<\/a>, which is a feature available in Chrome and Firefox. Blackboxing allows you to define JavaScript files to be excluded from pausing, so you will only pause on your own exceptions.<\/p>\n<p>Chrome allows to set regular expressions for blackboxed scripts. Using these two patterns (which you can add via <i>Chrome DevTools =&gt; Settings =&gt; Blackboxing<\/i>), you will exclude most of JavaScript errors that may be surfaced by other (read: not yours) components.<\/p>\n<p><code>\/aura_prod.*.js$<\/code><br \/>\n<code>\/components\/.*.js$<\/code><\/p>\n<h2>Check out the video walkthrough<\/h2>\n<p>All the information of this blog post is also available as a short walkthrough video in our newly launched <a href=\"https:\/\/developer.salesforce.com\/tv\/lwc-video-gallery\">Lightning Web Components Video Gallery<\/a>.<\/p>\n<h2>Summary<\/h2>\n<p>Lightning Web Components are not only based on modern web standards: they are also debuggable using standard tooling. While production mode gives you good capabilities for peeking into potential issues, the new and enriched functionality for debug mode makes the experience better. In one of the next releases (#safeharbor), we&#8217;ll iterate over the experience and will add new functionality like <a href=\"https:\/\/www.html5rocks.com\/en\/tutorials\/developertools\/sourcemaps\/\">JavaScript source maps<\/a> to make debugging even easier.<\/p>\n<p>If you want to learn more about how to use the Chrome DevTools, check out the <a href=\"https:\/\/developers.google.com\/web\/tools\/chrome-devtools\/\">documentation<\/a>. This <a href=\"https:\/\/umaar.com\/dev-tips\/\">website<\/a> also contains a lot of useful tips to make you even more productive with Chrome DevTools. Once you&#8217;re ramped up, you should try your newly gained knowledge by deploying one of the Lightning Web Components apps from the <a href=\"https:\/\/trailhead.salesforce.com\/sample-gallery\">Trailhead Sample Gallery<\/a>.<\/p>\n<p>Another important element that we haven&#8217;t yet discussed is how to actually unit test your Lightning Web Components functionality before you deploy them, so that you may not have to debug your code at all. We&#8217;ll cover that in an upcoming blog post.<\/p>\n<h2>About the author<\/h2>\n<p>Ren\u00e9 Winkelmeyer works as Principal Developer Evangelist at Salesforce. He focuses on enterprise integrations, Lightning, and all the other cool stuff that you can do with the Salesforce Platform. You can follow him on Twitter <a href=\"https:\/\/twitter.com\/muenzpraeger\">@muenzpraeger<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You built your first Lightning web component, everything looks great in the IDE, but something is not working as expected in your Salesforce org. That&#8217;s the point where it&#8217;s important to know how you can debug Lightning web components. This blog post will show you the available techniques. Lightning web components in production mode Before [&hellip;]<\/p>\n","protected":false},"author":3071,"featured_media":190096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2528,2766],"tags":[2598,2586,2678],"coauthors":[],"class_list":["post-190088","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-integration-apis","category-tutorials","tag-february-2019","tag-lightning-web-components","tag-lwc"],"podcast_audio":{"audio_url":"","duration":""},"featured_image":"https:\/\/d259t2jj6zp7qm.cloudfront.net\/images\/v1549910120-trailhead_module_lightning-web-components-basics_jtkkt7.png?w=200","related_posts":[{"post":{"ID":201348,"post_author":"3687","post_date":"2024-04-30 09:00:47","post_date_gmt":"2024-04-30 15:00:47","post_content":"Security is one of the most critical elements of storing your data on a device. We\u2019re excited to announce that in Spring \u201924, Salesforce is introducing the <a href=\"https:\/\/developer.salesforce.com\/docs\/atlas.en-us.mobile_offline.meta\/mobile_offline\/use_biometricsservice.htm\">BiometricsService<\/a> mobile capability! BiometricsService enables developers to add additional security measures to the data being stored on Lightning web components (LWCs).\r\n\r\nLet\u2019s say, for example, that you are looking to build an LWC to store sensitive data, such as a contact\u2019s physical address and identification information. However, these are sensitive data points that you wouldn\u2019t want just anyone to have access to. Through BiometricsService, you will be able to use security measures, such as FaceID and fingerprint scanning, to add additional security to the data being processed within your Salesforce mobile apps.\r\n\r\nLet\u2019s take a look at how!\r\n<h2>Work with the BiometricsService API<\/h2>\r\nBefore we discuss how to use the BiometricsService API, let\u2019s walk through a quick example of BiometricsService using <a href=\"https:\/\/github.com\/trailheadapps\/dreamhouse-lwc\">Dreamhouse<\/a>, a sample app that features some LWCs for mobile use cases in a real estate context.\r\n\r\nSay that you\u2019re a real estate agent who has closed a deal with a client on a new home, and you are updating the Opportunity information in Salesforce. To process the transaction, you will need to collect the following paperwork and personal details on the Opportunity record.\r\n<ul>\r\n \t<li>Purchase agreements<\/li>\r\n \t<li>Buyer and seller details\r\n<ul>\r\n \t<li>Phone numbers<\/li>\r\n \t<li>Current residency details<\/li>\r\n<\/ul>\r\n<\/li>\r\n \t<li>Purchased home address information<\/li>\r\n \t<li>And more!<\/li>\r\n<\/ul>\r\nYou are filling out these details on the spot, and given the sensitive nature of the data you are updating, you do not want just anyone to have access to this information when they are accessing your device. As you go from one place to another, you will need to access this information, but what if you misplace your phone or someone else not authorized to access this data attempts to do so? How can you stop this?\r\n\r\nEnter BiometricsService! Using the BiometricsService API, you can add security measures, such as fingerprint unlock or Face ID scan, so that you have an additional security measure on the device at all times. You are protecting sensitive data access on the Opportunity record directly via the LWC.\r\n\r\n<i><b>Note:<\/b> BiometricsService is a mobile-only capability via LWC. It does not support biometrics unlock of LWCs when configured via web devices using features like fingerprint scan via Touch ID on desktop.<\/i>\r\n<h2><b>Configure the BiometricsService API <\/b><\/h2>\r\nThe BiometricsService API enables you to verify device ownership when interfacing with an LWC. This can be done through two steps:\r\n<ol>\r\n \t<li>Configure your LWC HTML template to include a <code>lightning-button<\/code> base component. This will be used to prompt the user for biometric authentication.<\/li>\r\n \t<li>Connect that button with the JavaScript API that BiometricsService provides to invoke auth capabilities.<\/li>\r\n<\/ol>\r\n<i><b>Note:<\/b> To use BiometricsService, the end user looking to use the functionality on a mobile device must first have a fingerprint or Face ID scan pre-configured on the device. Reference the official <a href=\"https:\/\/support.apple.com\/guide\/iphone\/set-up-touch-id-iph672384a0b\/ios\">iOS<\/a> and <a href=\"https:\/\/developer.android.com\/codelabs\/biometric-login#0\">Android<\/a> device on how to configure. <\/i>\r\n\r\nLet\u2019s dive into more details on these steps!\r\n<h3><b>Step 1: Configure your LWC HTML template<\/b><\/h3>\r\nFor this LWC, we\u2019ll use the <code>handleVerifyClick<\/code> onclick method call, which invokes the API we\u2019ll need to begin using BiometricsService on LWC. This onclick method can be housed in the <code>lightning-button<\/code> HTML base component which, when invoked, will begin prompting the user for device ownership.\r\n\r\n<i><b>Tip:<\/b> When prompting biometric auth, you would want it to be a very upfront action for the end user trying to access the LWCs holding the aforementioned sensitive data. As such, a general recommendation is to house the <code>lightning-button<\/code> component within a <code>lightning-card<\/code> base component, which will render a card-style modal as a banner at the forefront for users when attempting to access sensitive data.<\/i>\r\n<pre language=\"html\">&lt;template&gt;\r\n  &lt;lightning-card title=&quot;Biometrics Service Demo&quot; icon-name=&quot;custom:privately_shared&quot;&gt;\r\n    &lt;div class=&quot;slds-var-m-around_medium&quot;&gt;\r\n      Use device biometrics capabilities to verify current user is indeed device owner:\r\n      &lt;lightning-button\r\n        variant=&quot;brand&quot;\r\n        label=&quot;Verify&quot; \r\n        title=&quot;Verify device ownership using biometrics&quot;\r\n        onclick={handleVerifyClick}\r\n        class=&quot;slds-var-m-left_x-small&quot;&gt;\r\n      &lt;\/lightning-button&gt;\r\n    &lt;\/div&gt;\r\n    &lt;div class=&quot;slds-var-m-around_medium&quot;&gt;\r\n      &lt;lightning-formatted-text value={status}&gt;&lt;\/lightning-formatted-text&gt;\r\n    &lt;\/div&gt;\r\n  &lt;\/lightning-card&gt;    \r\n&lt;\/template&gt;\r\n<\/pre>\r\nOnce those HTML configs are set, you will get a view of BiometricsService running within your LWC. Here is a sample view of the HTML payload from above, running in iOS:\r\n\r\n<img src=\"https:\/\/developer.salesforce.com\/blogs\/wp-content\/uploads\/2024\/04\/image-2024-04-29T143243.496-507x1000.png\" alt=\"The BiometricsService mobile capability running on LWC in iOS\" width=\"507\" height=\"1000\" class=\"alignnone size-medium wp-image-201349\" \/>\r\n<h3><b>Step 2: Connect your user interface with the BiometricsService API<\/b><\/h3>\r\nIn Step 1, we configured the <code>handleVerifyClick<\/code> method on the LWC in the HTML file. Here we will need to connect that method to the BiometricsService API that we import via <code>mobileCapabilities<\/code>.\r\n\r\nYou can use the following API calls to interface with BiometricsService.\r\n<table>\r\n<tbody>\r\n<tr>\r\n<td>API Call<\/td>\r\n<td>Params<\/td>\r\n<td>Response<\/td>\r\n<td>Description<\/td>\r\n<\/tr>\r\n<tr>\r\n<td><code><a href=\"https:\/\/developer.salesforce.com\/docs\/platform\/lwc\/guide\/reference-lightning-biometricsservice-factory.html\">getBiometricsService<\/a><\/code><\/td>\r\n<td>None<\/td>\r\n<td><code>BiometricsService<\/code><\/td>\r\n<td>Initializes Biometrics Service in your JavaScript class after importing the module from the <a href=\"https:\/\/developer.salesforce.com\/docs\/platform\/lwc\/guide\/reference-lightning-mobilecapabilities.html\">lightning\/MobileCapabilities module<\/a>.<\/td>\r\n<\/tr>\r\n<tr>\r\n<td><code><a href=\"https:\/\/developer.salesforce.com\/docs\/platform\/lwc\/guide\/reference-lightning-biometricsservice-isavailable.html\">isAvailable<\/a><\/code><\/td>\r\n<td>None<\/td>\r\n<td><code>true \/ false<\/code><\/td>\r\n<td>Allows you to check whether BiometricsService is available on device to invoke. Reference our <a href=\"https:\/\/developer.salesforce.com\/docs\/atlas.en-us.mobile_offline.meta\/mobile_offline\/use_biometricsservice_compatibility.htm\">Compatibility &amp; Requirements<\/a> for more details on list of supported devices.<\/td>\r\n<\/tr>\r\n<tr>\r\n<td><code><a href=\"https:\/\/developer.salesforce.com\/docs\/platform\/lwc\/guide\/reference-lightning-biometricsservice-isbiometricsready.html\">isBiometricsReady<\/a><\/code><\/td>\r\n<td>None<\/td>\r\n<td><code>true \/ false<\/code><\/td>\r\n<td>Checks whether Biometrics is ready to use after it has been initialized.<\/td>\r\n<\/tr>\r\n<tr>\r\n<td><code><a href=\"https:\/\/developer.salesforce.com\/docs\/platform\/lwc\/guide\/reference-lightning-biometricsservice-checkuserisdeviceowner.html\">checkUserIsDeviceOwner<\/a><\/code><\/td>\r\n<td>String (<a href=\"https:\/\/developer.salesforce.com\/docs\/platform\/lwc\/guide\/reference-lightning-biometricsservice-data-types.html\">Options<\/a>)<\/td>\r\n<td><code>true \/ false<\/code><\/td>\r\n<td>Allows you to check whether the fingerprint or Face ID scanned matches with the fingerprint or Face ID scan that is provided by the user on the mobile device.<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\nWhen using this API in your JavaScript LWC code, it would look like this:\r\n<pre language=\"javascript\">import { LightningElement } from 'lwc';\r\nimport { getBiometricsService } from 'lightning\/mobileCapabilities';\r\n\r\nexport default class NimbusPluginBiometricsService extends LightningElement {\r\n    status;\r\n    biometricsService;\r\n\r\n    connectedCallback() {\r\n      this.biometricsService = getBiometricsService();\r\n    }\r\n\r\n    handleVerifyClick() {\r\n      if (this.biometricsService.isAvailable()) {\r\n        const options = {\r\n          permissionRequestBody: \"Required to confirm device ownership.\",\r\n          additionalSupportedPolicies: ['PIN_CODE']\r\n        };\r\n        this.biometricsService.checkUserIsDeviceOwner(options)\r\n          .then((result) =&gt; {\r\n            \/\/ Do something with the result\r\n            if (result === true) {\r\n              this.status = \"\u2714 Current user is device owner.\"\r\n            } else {\r\n              this.status = \"\ud800\udd02 Current user is NOT device owner.\"\r\n            }\r\n          })\r\n          .catch((error) =&gt; {\r\n            \/\/ Handle errors\r\n            this.status = 'Error code: ' + error.code + '\\nError message: ' + error.message;\r\n          });\r\n      } else {\r\n        \/\/ service not available\r\n        this.status = 'Problem initiating Biometrics service. Are you using a mobile device?';\r\n      }\r\n    }\r\n}\r\n<\/pre>\r\n<b>Important Notes<\/b>\r\n<ul>\r\n \t<li>The <code>options<\/code> constant is a required parameter, and when checking device ownership, the <code>addionalSupportedPolicies<\/code> object allows you to configure the fallback options in the event that the biometrics scan fails. In this case, adding <code>PIN_CODE<\/code> in the object array will alert BiometricsService to prompt for the device pin code as the fallback.<\/li>\r\n \t<li>If the barcode scan fails, it will return a set of failure codes. Reference <a href=\"https:\/\/developer.salesforce.com\/docs\/platform\/lwc\/guide\/reference-lightning-biometricsservice-constants.html#biometricsservicefailurecode\">BiometricsServiceFailureCodes<\/a> for more details.<\/li>\r\n<\/ul>\r\n<h2>BiometricsService compatibility<\/h2>\r\nBiometricsService is available in the Spring \u201924 release across the Salesforce Mobile App, Salesforce Mobile App Plus, and Mobile Publisher offerings. See the <a href=\"https:\/\/developer.salesforce.com\/docs\/atlas.en-us.mobile_offline.meta\/mobile_offline\/capabilities.htm\">Mobile Capabilities Compatibility Summary<\/a> to stay up to date with its availability across our Salesforce mobile apps.\r\n<h2><b>Conclusion<\/b><\/h2>\r\nWe hope that you\u2019ve enjoyed this blog post and that you are looking forward to using the biometrics scanning capabilities on your LWC for mobile. To get started:\r\n<ul>\r\n \t<li><b>Dive in!<\/b> Take a look at our <a href=\"https:\/\/developer.salesforce.com\/docs\/atlas.en-us.mobile_offline.meta\/mobile_offline\/use_biometricsservice.htm\">example LWCs<\/a> to get familiar with the plugin.<\/li>\r\n \t<li><b>Personalize it!<\/b> Take BiometricsService capabilities and expand on them to customize them for your business needs.<\/li>\r\n \t<li><b>Reach out!<\/b> If you have any questions, comments, or ideas, you can connect with us in the <a href=\"https:\/\/trailhead.salesforce.com\/trailblazer-community\/groups\/0F9300000001qepCAA?tab=discussion&amp;sort=LAST_MODIFIED_DATE_DESC\">Salesforce Mobile Trailblazer Community<\/a>.<\/li>\r\n<\/ul>\r\nTo learn more about Salesforce\u2019s mobile offerings, check out the <a href=\"https:\/\/developer.salesforce.com\/docs\/atlas.en-us.mobile_offline.meta\/mobile_offline\/intro.htm\">Mobile and Offline Developer Guide<\/a>.\r\n<h2><b>About the author<\/b><\/h2>\r\n<b>Ashwin Nair <\/b>is a<b> <\/b>Product Manager at Salesforce focused on Salesforce Mobile. He is currently working on mobile platform experiences and has been in the web and mobile development space for over seven years. Follow him on <a href=\"https:\/\/www.linkedin.com\/in\/ashwin-nair\/\">LinkedIn<\/a>.","post_title":"Introducing the BiometricsService Mobile Capability","post_excerpt":"The BiometricsService mobile capability enables developers to add additional security measures to the data being stored on LWCs.","post_status":"publish","comment_status":"open","ping_status":"closed","post_password":"","post_name":"introducing-the-biometricsservice-mobile-capability","to_ping":"","pinged":"","post_modified":"2025-11-05 02:13:27","post_modified_gmt":"2025-11-05 09:13:27","post_content_filtered":"","post_parent":0,"guid":"https:\/\/developer.salesforce.com\/blogs\/?p=201348","menu_order":0,"post_type":"post","post_mime_type":"","comment_count":"0","filter":"raw","featured_image":"https:\/\/d259t2jj6zp7qm.cloudfront.net\/images\/20240429143606\/Single-Headshot-%E2%80%93-Light-1.png?w=1200","link":"https:\/\/developer.salesforce.com\/blogs\/2024\/04\/introducing-the-biometricsservice-mobile-capability","podcast_audio":{"audio_url":"","duration":""},"authors":[{"name":"Ashwin Nair","image_src":"https:\/\/secure.gravatar.com\/avatar\/1e6242e3f9fd391e0e9c61a52fa9bae3e8cfd36444ff402b1dfe843792de92b3?s=24&d=mm&r=g"}]}}],"unstyled_content":"<p>You built your first Lightning web component, everything looks great in the IDE, but something is not working as expected in your Salesforce org. That&#8217;s the point where it&#8217;s important to know how you can debug Lightning web components. This blog post will show you the available techniques.<\/p>\n<h2>Lightning web components in production mode<\/h2>\n<p>Before we look into debugging, it&#8217;s important to understand how we serve Lightning Web Components to the browser in what we call production mode and what utilities you have at hand for them. That mode is what you experience out of the box when a user uses Salesforce. It provides you two things when it comes to Lightning Web Components:<\/p>\n<ul>\n<li>Minified JavaScript<\/li>\n<li>Proxied values<\/li>\n<\/ul>\n<p>While it&#8217;s not related to debugging, it&#8217;s also noteworthy that we ship heavy JavaScript transformations for older browsers, like IE11. That way you can use modern JavaScript and actually don&#8217;t have to care what browser your users are using.<\/p>\n<h3>Minified JavaScript<\/h3>\n<p>Minification means that we compress JavaScript into as few bytes as possible by removing any unnecessary characters and elements like line breaks, whitespace, tabs, code comments and so forth. This reduces the overall traffic that&#8217;s required for sending a file to a browser. Minifaction also changes the names of functions or variables, for example <code>const mySuperVariable<\/code> can become <code>const d<\/code> . Every Lightning Web Component JavaScript file that your browser receives from Salesforce in production mode is minified.<\/p>\n<p>Without any special setting, you can use the pretty format option in Chrome DevTools (or similar counterpart in your preferred browser) to get some sort of code formatting. This doesn&#8217;t give you full readability because of the changed names of variables and functions, but it&#8217;s pretty decent for a first check. This code is already debuggable, which means you can set breakpoints, inspect values during runtime, and use Chrome DevTools to work with the debugged values.<\/p>\n<p>\n\t\t\t  <span >\n\t\t\t    <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/d259t2jj6zp7qm.cloudfront.net\/images\/v1549909394-minified_pretty_print_krzxhi.gif\" width=\"1226\" height=\"738\" alt=\"\" \/>\n\t\t\t  <\/span>\n\t\t\t<\/p>\n<p>Note, that you see in the GIF already the location of custom Lightning web components in the <i>Source<\/i> tab &#8211; it&#8217;s <code>modules<\/code> (compared to <code>components<\/code> for Aura components).<\/p>\n<h3>Proxied values<\/h3>\n<p>Next, we proxy certain things, like data that is provisioned via decorators (@api, @track, @wire). Some of that is to be considered read-only, like @api and @wire decorated properties. By using <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Global_Objects\/Proxy\">JavaScript Proxies<\/a> we make sure that they stay read-only. And for @track decorated properties, we use proxies to observe data mutation. This also means that you only see the Proxy object and you either have to use something like <code>JSON.stringify()<\/code> in Chrome DevTools (note: if you have an Object with circular references, it&#8217;ll throw when stringified), or you have to inspect the object structure itself.<\/p>\n<p>\n\t\t\t  <span >\n\t\t\t    <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/d259t2jj6zp7qm.cloudfront.net\/images\/c_scale%2Cw_800-proxied_values_zmcojq.png\" width=\"800\" height=\"468\" alt=\"\" \/>\n\t\t\t  <\/span>\n\t\t\t<\/p>\n<p>Now, you already get <i>some<\/i> good debugging information in production mode. But what if you want the real cool stuff? Let&#8217;s take a look at that.<\/p>\n<h2>Lightning web components in debug mode<\/h2>\n<p>Besides production mode, you can enable debug mode for specific users. Debug mode gives you a few things, and particularly a few things that were not available previously for Aura components:<\/p>\n<ul>\n<li>Unminified JavaScript<\/li>\n<li>Custom formatting<\/li>\n<li>Developer mode console warnings<\/li>\n<\/ul>\n<p>You can read more about debug mode and how to enable it for users in the <a href=\"https:\/\/developer.salesforce.com\/docs\/component-library\/documentation\/lwc\/lwc.debug_mode_enable\">Lightning Web Components documentation<\/a>. You can also use Salesforce CLI to create a new user in a scratch org with debug mode enabled using this command:<\/p>\n<pre language=\"bash\">sfdx force:user:create -a mydebuguser UserPreferencesUserDebugModePref=true<\/pre>\n<p>More information on how to use the <code>force:user:create<\/code> command can be found <a href=\"https:\/\/developer.salesforce.com\/docs\/atlas.en-us.sfdx_cli_reference.meta\/sfdx_cli_reference\/cli_reference_force_user.htm\">in the documentation<\/a>.<\/p>\n<h3>Unminified JavaScript<\/h3>\n<p>Real exciting is that we ship unminified JavaScript in debug mode. What you get in the browser is what you coded (at least in JavaScript + CSS). The mapping from what&#8217;s in your IDE to browser is close to 1:1. That&#8217;s pretty cool, right? Especially in longer JavaScript classes you don&#8217;t have to guess, or remember, what variable <code>d<\/code> was again \u2014 you&#8217;ll now see the name as it lives in your source code. And you can debug it, like you can do with minified JavaScript.<\/p>\n<p>\n\t\t\t  <span >\n\t\t\t    <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/d259t2jj6zp7qm.cloudfront.net\/images\/c_scale%2Cw_800-unminified_snefw6.png\" width=\"800\" height=\"468\" alt=\"\" \/>\n\t\t\t  <\/span>\n\t\t\tNote that the JavaScript file in the browser also includes additional code, like transformed decorators or relative imports that got rolled up. Check out the video at the bottom to see more.<\/p>\n<p>A tip on debugging data that you receive via decorated properties (@api or @wire): if you bind the decorator to a property you won&#8217;t currently be able to debug it. In case you see some behavior that you need to debug, change the property to a function (for @wire) or to a setter (for @api). Then you can debug based on the deconstructed <code>data<\/code> and <code>error<\/code> property.<\/p>\n<h3>Custom formatting<\/h3>\n<p>As you recall from the previous section, we&#8217;re using JavaScript proxies to enforce that certain types of data are read-only. To simplify the readability for you, we&#8217;re shipping a custom formatter in debug mode for these proxies. That means you won&#8217;t see the proxy object in Chrome, but instead the real value. We&#8217;re basically unwrapping the visual aspect of the proxy (but it&#8217;s still proxied, so no chance to modify the data, ok?!).<\/p>\n<p>\n\t\t\t  <span >\n\t\t\t    <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/d259t2jj6zp7qm.cloudfront.net\/images\/c_scale%2Cw_800-custom_formatter_aghy0l.png\" width=\"800\" height=\"409\" alt=\"\" \/>\n\t\t\t  <\/span>\n\t\t\tCustom formatters aren&#8217;t enabled by default in Chrome, so you&#8217;ll need to set <i>Chrome DevTools =&gt; Settings =&gt; Enable custom formatters<\/i>.<\/p>\n<h3>Console engine warnings<\/h3>\n<p>The third feature we&#8217;re shipping for helping you to better debug your Lightning web components are \u201cLWC engine\u201d warnings. In debug mode the Lightning Web Components engine actually identifies bad patterns that are only detectable during runtime, and then prints them as console warnings.<\/p>\n<p>\n\t\t\t  <span >\n\t\t\t    <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/d259t2jj6zp7qm.cloudfront.net\/images\/c_scale%2Cf_gif%2Cw_800-console_warnings_wzkn6r.gif\" width=\"800\" height=\"467\" alt=\"\" \/>\n\t\t\t  <\/span>\n\t\t\t<\/p>\n<p>It&#8217;s a best practice to develop your Lightning web components in an org using debug mode. That way you see if your code can be even more improved while you develop.<\/p>\n<p>There&#8217;s one caveat at the time of this writing: you&#8217;ll likely see other console warnings from the LWC engine on the console, as we with the initial release don&#8217;t filter on your own namespace. Because of that, you see other warnings for things like base Lightning components. Also note that in the current version of the filter in Chrome DevTools has no effect on the logged warnings themselves. Some of the warning messages are also obsolete and will be removed soon, like <code>Property \u201cxyz\u201d of [object] <\/code>is set to a non-trackable object, which means changes into that object cannot be observed (meaning you don&#8217;t have to care about that at the moment). And yes, we&#8217;ll improve that in the next few months (#safeharbor).<\/p>\n<p>The best way to actually filter for only your own components is to remove the \u201cinfo\u201d log level which hides the stack traces.<\/p>\n<h2>Pausing on caught exceptions<\/h2>\n<p>This doesn&#8217;t mean that you should take a break when your code hits an exception (although sometimes it&#8217;s the right thing to do). This means that you can \u2014 and should \u2014 leverage the functionality in your browser to pause JavaScript execution when an error is caught.<\/p>\n<p>When having <a href=\"https:\/\/developers.google.com\/web\/updates\/2015\/05\/automatically-pause-on-any-exception\">this feature activated<\/a>, you&#8217;ll find yourself in the situation that your browser will also halt on any exceptions that are not caused by your own code, but by ours. In that case, we recommend that you make use of <a href=\"https:\/\/developer.chrome.com\/devtools\/docs\/blackboxing\">blackboxing<\/a>, which is a feature available in Chrome and Firefox. Blackboxing allows you to define JavaScript files to be excluded from pausing, so you will only pause on your own exceptions.<\/p>\n<p>Chrome allows to set regular expressions for blackboxed scripts. Using these two patterns (which you can add via <i>Chrome DevTools =&gt; Settings =&gt; Blackboxing<\/i>), you will exclude most of JavaScript errors that may be surfaced by other (read: not yours) components.<\/p>\n<p><code>\/aura_prod.*.js$<\/code><br \/>\n<code>\/components\/.*.js$<\/code><\/p>\n<h2>Check out the video walkthrough<\/h2>\n<p>All the information of this blog post is also available as a short walkthrough video in our newly launched <a href=\"https:\/\/developer.salesforce.com\/tv\/lwc-video-gallery\">Lightning Web Components Video Gallery<\/a>.<\/p>\n<h2>Summary<\/h2>\n<p>Lightning Web Components are not only based on modern web standards: they are also debuggable using standard tooling. While production mode gives you good capabilities for peeking into potential issues, the new and enriched functionality for debug mode makes the experience better. In one of the next releases (#safeharbor), we&#8217;ll iterate over the experience and will add new functionality like <a href=\"https:\/\/www.html5rocks.com\/en\/tutorials\/developertools\/sourcemaps\/\">JavaScript source maps<\/a> to make debugging even easier.<\/p>\n<p>If you want to learn more about how to use the Chrome DevTools, check out the <a href=\"https:\/\/developers.google.com\/web\/tools\/chrome-devtools\/\">documentation<\/a>. This <a href=\"https:\/\/umaar.com\/dev-tips\/\">website<\/a> also contains a lot of useful tips to make you even more productive with Chrome DevTools. Once you&#8217;re ramped up, you should try your newly gained knowledge by deploying one of the Lightning Web Components apps from the <a href=\"https:\/\/trailhead.salesforce.com\/sample-gallery\">Trailhead Sample Gallery<\/a>.<\/p>\n<p>Another important element that we haven&#8217;t yet discussed is how to actually unit test your Lightning Web Components functionality before you deploy them, so that you may not have to debug your code at all. We&#8217;ll cover that in an upcoming blog post.<\/p>\n<h2>About the author<\/h2>\n<p>Ren\u00e9 Winkelmeyer works as Principal Developer Evangelist at Salesforce. He focuses on enterprise integrations, Lightning, and all the other cool stuff that you can do with the Salesforce Platform. You can follow him on Twitter <a href=\"https:\/\/twitter.com\/muenzpraeger\">@muenzpraeger<\/a>.<\/p>\n","acf":{"canonicalid":"","language":"english","audio_url":"https:\/\/a.sfdcstatic.com\/developer-website\/blog-audio\/190088\/190088.mp3","hash":"4b41735ec15f013ca856644f22b0fd6b","transcription_id":"0db00735-7d45-4787-9a58-b5fc58a1b675","ready":true},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v24.3 (Yoast SEO v25.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Debug Your Lightning Web Components - Salesforce Developers Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/developer.salesforce.com\/blogs\/2019\/02\/debug-your-lightning-web-components\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Debug Your Lightning Web Components\" \/>\n<meta property=\"og:description\" content=\"You built your first Lightning web component, everything looks great in the IDE, but something is not working as expected in your Salesforce org. That&#8217;s the point where it&#8217;s important to know how you can debug Lightning web components. This blog post will show you the available techniques. Lightning web components in production mode Before [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/developer.salesforce.com\/blogs\/2019\/02\/debug-your-lightning-web-components\" \/>\n<meta property=\"og:site_name\" content=\"Salesforce Developers Blog\" \/>\n<meta property=\"article:published_time\" content=\"2019-02-11T19:00:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-05T09:22:30+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/d259t2jj6zp7qm.cloudfront.net\/images\/v1549910120-trailhead_module_lightning-web-components-basics_jtkkt7.png\" \/>\n\t<meta property=\"og:image:width\" content=\"200\" \/>\n\t<meta property=\"og:image:height\" content=\"200\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Ren\u00e9 Winkelmeyer\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@muenzpraeger\" \/>\n<meta name=\"twitter:site\" content=\"@SalesforceDevs\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ren\u00e9 Winkelmeyer\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/developer.salesforce.com\/blogs\/2019\/02\/debug-your-lightning-web-components\",\"url\":\"https:\/\/developer.salesforce.com\/blogs\/2019\/02\/debug-your-lightning-web-components\",\"name\":\"Debug Your Lightning Web Components - Salesforce Developers Blog\",\"isPartOf\":{\"@id\":\"https:\/\/developer.salesforce.com\/blogs\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/developer.salesforce.com\/blogs\/2019\/02\/debug-your-lightning-web-components#primaryimage\"},\"image\":{\"@id\":\"https:\/\/developer.salesforce.com\/blogs\/2019\/02\/debug-your-lightning-web-components#primaryimage\"},\"thumbnailUrl\":\"https:\/\/d259t2jj6zp7qm.cloudfront.net\/images\/v1549910120-trailhead_module_lightning-web-components-basics_jtkkt7.png\",\"datePublished\":\"2019-02-11T19:00:51+00:00\",\"dateModified\":\"2025-11-05T09:22:30+00:00\",\"author\":{\"@id\":\"https:\/\/developer.salesforce.com\/blogs\/#\/schema\/person\/39898e09667c18948ea14200a398c1d0\"},\"breadcrumb\":{\"@id\":\"https:\/\/developer.salesforce.com\/blogs\/2019\/02\/debug-your-lightning-web-components#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/developer.salesforce.com\/blogs\/2019\/02\/debug-your-lightning-web-components\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/developer.salesforce.com\/blogs\/2019\/02\/debug-your-lightning-web-components#primaryimage\",\"url\":\"https:\/\/d259t2jj6zp7qm.cloudfront.net\/images\/v1549910120-trailhead_module_lightning-web-components-basics_jtkkt7.png\",\"contentUrl\":\"https:\/\/d259t2jj6zp7qm.cloudfront.net\/images\/v1549910120-trailhead_module_lightning-web-components-basics_jtkkt7.png\",\"width\":\"200\",\"height\":\"200\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/developer.salesforce.com\/blogs\/2019\/02\/debug-your-lightning-web-components#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/developer.salesforce.com\/blogs\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Debug Your Lightning Web Components\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/developer.salesforce.com\/blogs\/#website\",\"url\":\"https:\/\/developer.salesforce.com\/blogs\/\",\"name\":\"Salesforce Developers Blog\",\"description\":\"Elevating developer skills and connecting with the Salesforce Developers community\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/developer.salesforce.com\/blogs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/developer.salesforce.com\/blogs\/#\/schema\/person\/39898e09667c18948ea14200a398c1d0\",\"name\":\"Ren\u00e9 Winkelmeyer\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/developer.salesforce.com\/blogs\/#\/schema\/person\/image\/5553df8fa142c10aef2f8ae461fdf88c\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9a703ac9d630a79d2e9ed3906c39e1da7bc89a5b1d3b6ce4218d58c17db49c63?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9a703ac9d630a79d2e9ed3906c39e1da7bc89a5b1d3b6ce4218d58c17db49c63?s=96&d=mm&r=g\",\"caption\":\"Ren\u00e9 Winkelmeyer\"},\"description\":\"Ren\u00e9 Winkelmeyer works as an Architect, Developer Relations, at Salesforce. He focuses on enterprise integrations, JavaScript, node, and all the other cool stuff that you can do with Salesforce technologies. You can follow him on Twitter @muenzpraeger or on GitHub @muenzpraeger.\",\"sameAs\":[\"https:\/\/blog.winkelmeyer.com\",\"https:\/\/www.linkedin.com\/in\/muenzpraeger\/\",\"https:\/\/x.com\/muenzpraeger\",\"https:\/\/www.youtube.com\/channel\/uch60rray2gi9m62z1loljca\"],\"url\":\"https:\/\/developer.salesforce.com\/blogs\/author\/rwinkelmeyer\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Debug Your Lightning Web Components - Salesforce Developers Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/developer.salesforce.com\/blogs\/2019\/02\/debug-your-lightning-web-components","og_locale":"en_US","og_type":"article","og_title":"Debug Your Lightning Web Components","og_description":"You built your first Lightning web component, everything looks great in the IDE, but something is not working as expected in your Salesforce org. That&#8217;s the point where it&#8217;s important to know how you can debug Lightning web components. This blog post will show you the available techniques. Lightning web components in production mode Before [&hellip;]","og_url":"https:\/\/developer.salesforce.com\/blogs\/2019\/02\/debug-your-lightning-web-components","og_site_name":"Salesforce Developers Blog","article_published_time":"2019-02-11T19:00:51+00:00","article_modified_time":"2025-11-05T09:22:30+00:00","og_image":[{"width":200,"height":200,"url":"https:\/\/d259t2jj6zp7qm.cloudfront.net\/images\/v1549910120-trailhead_module_lightning-web-components-basics_jtkkt7.png","type":"image\/png"}],"author":"Ren\u00e9 Winkelmeyer","twitter_card":"summary_large_image","twitter_creator":"@muenzpraeger","twitter_site":"@SalesforceDevs","twitter_misc":{"Written by":"Ren\u00e9 Winkelmeyer","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/developer.salesforce.com\/blogs\/2019\/02\/debug-your-lightning-web-components","url":"https:\/\/developer.salesforce.com\/blogs\/2019\/02\/debug-your-lightning-web-components","name":"Debug Your Lightning Web Components - Salesforce Developers Blog","isPartOf":{"@id":"https:\/\/developer.salesforce.com\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/developer.salesforce.com\/blogs\/2019\/02\/debug-your-lightning-web-components#primaryimage"},"image":{"@id":"https:\/\/developer.salesforce.com\/blogs\/2019\/02\/debug-your-lightning-web-components#primaryimage"},"thumbnailUrl":"https:\/\/d259t2jj6zp7qm.cloudfront.net\/images\/v1549910120-trailhead_module_lightning-web-components-basics_jtkkt7.png","datePublished":"2019-02-11T19:00:51+00:00","dateModified":"2025-11-05T09:22:30+00:00","author":{"@id":"https:\/\/developer.salesforce.com\/blogs\/#\/schema\/person\/39898e09667c18948ea14200a398c1d0"},"breadcrumb":{"@id":"https:\/\/developer.salesforce.com\/blogs\/2019\/02\/debug-your-lightning-web-components#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/developer.salesforce.com\/blogs\/2019\/02\/debug-your-lightning-web-components"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/developer.salesforce.com\/blogs\/2019\/02\/debug-your-lightning-web-components#primaryimage","url":"https:\/\/d259t2jj6zp7qm.cloudfront.net\/images\/v1549910120-trailhead_module_lightning-web-components-basics_jtkkt7.png","contentUrl":"https:\/\/d259t2jj6zp7qm.cloudfront.net\/images\/v1549910120-trailhead_module_lightning-web-components-basics_jtkkt7.png","width":"200","height":"200"},{"@type":"BreadcrumbList","@id":"https:\/\/developer.salesforce.com\/blogs\/2019\/02\/debug-your-lightning-web-components#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/developer.salesforce.com\/blogs"},{"@type":"ListItem","position":2,"name":"Debug Your Lightning Web Components"}]},{"@type":"WebSite","@id":"https:\/\/developer.salesforce.com\/blogs\/#website","url":"https:\/\/developer.salesforce.com\/blogs\/","name":"Salesforce Developers Blog","description":"Elevating developer skills and connecting with the Salesforce Developers community","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/developer.salesforce.com\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/developer.salesforce.com\/blogs\/#\/schema\/person\/39898e09667c18948ea14200a398c1d0","name":"Ren\u00e9 Winkelmeyer","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/developer.salesforce.com\/blogs\/#\/schema\/person\/image\/5553df8fa142c10aef2f8ae461fdf88c","url":"https:\/\/secure.gravatar.com\/avatar\/9a703ac9d630a79d2e9ed3906c39e1da7bc89a5b1d3b6ce4218d58c17db49c63?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9a703ac9d630a79d2e9ed3906c39e1da7bc89a5b1d3b6ce4218d58c17db49c63?s=96&d=mm&r=g","caption":"Ren\u00e9 Winkelmeyer"},"description":"Ren\u00e9 Winkelmeyer works as an Architect, Developer Relations, at Salesforce. He focuses on enterprise integrations, JavaScript, node, and all the other cool stuff that you can do with Salesforce technologies. You can follow him on Twitter @muenzpraeger or on GitHub @muenzpraeger.","sameAs":["https:\/\/blog.winkelmeyer.com","https:\/\/www.linkedin.com\/in\/muenzpraeger\/","https:\/\/x.com\/muenzpraeger","https:\/\/www.youtube.com\/channel\/uch60rray2gi9m62z1loljca"],"url":"https:\/\/developer.salesforce.com\/blogs\/author\/rwinkelmeyer"}]}},"jetpack_featured_media_url":"https:\/\/d259t2jj6zp7qm.cloudfront.net\/images\/v1549910120-trailhead_module_lightning-web-components-basics_jtkkt7.png","authors":[{"name":"Ren\u00e9 Winkelmeyer","image_src":"https:\/\/secure.gravatar.com\/avatar\/9a703ac9d630a79d2e9ed3906c39e1da7bc89a5b1d3b6ce4218d58c17db49c63?s=24&d=mm&r=g"}],"_links":{"self":[{"href":"https:\/\/developer.salesforce.com\/blogs\/wp-json\/wp\/v2\/posts\/190088","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.salesforce.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.salesforce.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.salesforce.com\/blogs\/wp-json\/wp\/v2\/users\/3071"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.salesforce.com\/blogs\/wp-json\/wp\/v2\/comments?post=190088"}],"version-history":[{"count":8,"href":"https:\/\/developer.salesforce.com\/blogs\/wp-json\/wp\/v2\/posts\/190088\/revisions"}],"predecessor-version":[{"id":198592,"href":"https:\/\/developer.salesforce.com\/blogs\/wp-json\/wp\/v2\/posts\/190088\/revisions\/198592"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/developer.salesforce.com\/blogs\/wp-json\/wp\/v2\/media\/190096"}],"wp:attachment":[{"href":"https:\/\/developer.salesforce.com\/blogs\/wp-json\/wp\/v2\/media?parent=190088"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.salesforce.com\/blogs\/wp-json\/wp\/v2\/categories?post=190088"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.salesforce.com\/blogs\/wp-json\/wp\/v2\/tags?post=190088"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/developer.salesforce.com\/blogs\/wp-json\/wp\/v2\/coauthors?post=190088"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}