<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>knockou-js-debugging - Tag Vibe</title>
	<atom:link href="https://www.tagvibe.com/tag/knockou-js-debugging/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.tagvibe.com</link>
	<description>Connect. Create. Conquer.</description>
	<lastBuildDate>Mon, 06 May 2024 09:37:33 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.1</generator>

<image>
	<url>https://www.tagvibe.com/wp-content/uploads/2024/05/cropped-cropped-logo-tagvibe-1-32x32.png</url>
	<title>knockou-js-debugging - Tag Vibe</title>
	<link>https://www.tagvibe.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to debug Magento 2 issues?</title>
		<link>https://www.tagvibe.com/how-to-debug-magento-2-issues/</link>
		
		<dc:creator><![CDATA[Rajat kar]]></dc:creator>
		<pubDate>Wed, 30 Sep 2020 19:52:42 +0000</pubDate>
				<category><![CDATA[Magento2]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[error-log]]></category>
		<category><![CDATA[js-issue]]></category>
		<category><![CDATA[knockou-js-debugging]]></category>
		<category><![CDATA[magento2]]></category>
		<guid isPermaLink="false">http://tagvibe.com/?p=103</guid>

					<description><![CDATA[<p>First Step is to check&#160;./var/log&#160;directory in Magento 2 installation whether any errors or exceptions in logs, report or you can check the system.log, debug.log. If you Magento application is in default or production mode then you will see the &#160;‘There has been an error processing your request’&#160;message on page front, grab the report id from that message and check&#160;./var/report&#160;directory to get the exact error. If you want to see the error message directly in the browser , run php bin/magento deploy:mode:set developer command to switch to developer mode. 3rd step is to make sure that you have all the correct permission Use&#160;chown(change owner) and&#160;chmod&#160;(change mode) for you Magento files and folder. Check the web server logs. Nginx for var/log/nginx and &#160;for Apache it’s&#160;/var/log/apache2&#160;or&#160;/var/log/httpd. Clear Magento 2 cache files by running the php bin/magento cache:clean command. you can also add the belwo code in your index.php the ini_set(‘display_startup_errors’,1); ini_set(‘display_errors’,1); error_reporting(-1); Debug the Frontend JS issue Check browser console for the errors and resolve accordingly. If you are using any third party cache like varnish please clear the cache. Enable the template path hints by navigate to the Go to Admin Panel &#62; Stores &#62; Settings &#62; Configuration &#62; Advanced &#62; Developer &#62; Debug. to know the correct block and phtml file to debug in specific file. Debug the Knockout JS issue At first we need to get a Knockout instance from the browser console. var ko = require('knockout'); Now we have Knockout instance in the&#160;ko&#160;variable. We can use it to get a context of any DOM element. var context = ko.contextFor($0); where&#160;$0&#160;is a&#160;special variable&#160;in browser console. It contains a link to a DOM element that is last inspected. // Admin > Products > Catalog > Add Product // Inspect "Product Name" var fieldName = ko.contextFor($0).$data; console.log(fieldName.name); // product_form.product_form.product-details.container_name.name OR You can install this https://chrome.google.com/webstore/detail/knockoutjs-context-debugg/oddcpmchholgcjgjdnfjmildmlielhof?hl=en knockout debugger and debug. Hope this article helped you in some way. Please leave us your comment and let us know what do you think? Thanks.</p>
<p>The post <a href="https://www.tagvibe.com/how-to-debug-magento-2-issues/">How to debug Magento 2 issues?</a> first appeared on <a href="https://www.tagvibe.com">Tag Vibe</a>.</p>]]></description>
										<content:encoded><![CDATA[<div class="wp-block-group gtfy-31"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<ul class="wp-block-list gtfy-28"><li>First Step is to check&nbsp;<em>./var/log&nbsp;</em>directory in Magento 2 installation whether any errors or exceptions in logs, report or you can check the <em>system.log</em>, debug.log.</li><li>If you Magento application is in default or production mode then you will see the &nbsp;‘<em>There has been an error processing your request’&nbsp;</em>message on page front, grab the report id from that message and check&nbsp;<em>./var/report</em>&nbsp;directory to get the exact error.</li><li>If you want to see the error message directly in the browser , run  <em>php bin/magento deploy:mode:set developer</em> command to switch to developer mode.</li><li>3rd step is to make sure that you have all the correct permission Use&nbsp;<em>chown</em>(change owner) and&nbsp;<em>chmod</em>&nbsp;(change mode) for you Magento files and folder.</li><li>Check the web server logs. Nginx for var/<strong>log</strong>/<strong>nginx</strong> and &nbsp;for Apache it’s&nbsp;<em>/var/log/apache2&nbsp;or&nbsp;/var/log/httpd</em>.</li><li>Clear Magento 2 cache files by running the php bin/magento cache:clean command.</li><li>you can also add the belwo code in your index.php<ul><li>the ini_set(‘display_startup_errors’,1);</li><li>ini_set(‘display_errors’,1);</li><li>error_reporting(-1);</li></ul></li></ul>



<p class="gtfy-29"><strong>Debug the Frontend JS issue</strong></p>



<ul class="wp-block-list gtfy-30"><li>Check browser console for the errors and resolve accordingly.</li><li>If you are using any third party cache like varnish please clear the cache.</li><li>Enable the template path hints by navigate to the Go to Admin Panel &gt; Stores &gt; Settings &gt; Configuration &gt; Advanced &gt; Developer &gt; Debug. to know the correct block and phtml file to debug in specific file.</li></ul>
</div></div>



<p class="gtfy-34"> <strong>Debug the Knockout JS issue</strong></p>



<ul class="wp-block-list gtfy-37"><li>At first we need to get a Knockout instance from the browser console.<ul><li><code>var ko = require('knockout'); </code></li></ul></li><li>Now we have Knockout instance in the&nbsp;<code>ko</code>&nbsp;variable. We can use it to get a context of any DOM element<strong>.</strong></li></ul>



<pre class="wp-block-preformatted gtfy-40"><code>var context = ko.contextFor($0);</code></pre>



<ul class="wp-block-list gtfy-43"><li>where&nbsp;<code>$0</code>&nbsp;is a&nbsp;<a href="https://developers.google.com/web/tools/chrome-devtools/debug/command-line/command-line-reference#section-1">special variable</a>&nbsp;in browser console. It contains a link to a DOM element that is last inspected.</li></ul>



<pre class="wp-block-preformatted gtfy-46"><code>// Admin > Products > Catalog > Add Product
// Inspect "Product Name"
var fieldName = ko.contextFor($0).$data;

console.log(fieldName.name); // product_form.product_form.product-details.container_name.name</code></pre>



<p class="gtfy-49">OR</p>



<p class="gtfy-52">You can install this <a href="https://chrome.google.com/webstore/detail/knockoutjs-context-debugg/oddcpmchholgcjgjdnfjmildmlielhof?hl=en knockout" target="_blank" rel="noreferrer noopener">https://chrome.google.com/webstore/detail/knockoutjs-context-debugg/oddcpmchholgcjgjdnfjmildmlielhof?hl=en knockout </a>debugger and debug.</p>



<p class="gtfy-55"><br>Hope this article helped you in some way. Please leave us your comment and let us know what do you think? Thanks.</p><p>The post <a href="https://www.tagvibe.com/how-to-debug-magento-2-issues/">How to debug Magento 2 issues?</a> first appeared on <a href="https://www.tagvibe.com">Tag Vibe</a>.</p>]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
