• Why am I getting an error with this line of code? I have disabled all plugins minus 2 that I can’t otherwise it kills my whole site – https:// wise

    Full Error:

    Uncaught TypeError: Cannot read property 'init' of undefined - https://domain.com/folder/wp-admin/load-scripts.php?c=0&load%5B%5D=hoverIntent,common,admin-bar,heartbeat,autosave,wp-ajax-response,jquery-color,wp-lists,quicktags,jquery-query,admin-comments,sug&load%5B%5D=gest,postbox,tags-box,word-count,post,editor-expand,thickbox,shortcode,wp-plupload,mediaelement,wp-mediaelement,media-views,medi&load%5B%5D=a-editor,media-audiovideo,mce-view,imgareaselect,image-edit,svg-painter,wp-auth-check,editor,wplink,media-upload,wp-embed&ver=4.6.1

    On clicking the above link it takes me to the following:

    Code Block:

    	$(document).ready( function() {
    		// detection for browser SVG capability
    		if ( document.implementation.hasFeature( 'https://www.w3.org/TR/SVG11/feature#Image', '1.1' ) ) {
    			$( document.body ).removeClass( 'no-svg' ).addClass( 'svg' );
    			wp.svgPainter.init();
    		}
    	});
Viewing 1 replies (of 1 total)
  • Hi @jzmwebdevelopmen,

    This seems to be a JavaScript error message. You could add a breakpoint at wp.svgpainter.init() and you may find out that wp.svgPainter is having a value undefined. When you hit this breakpoint switch over to console tab of chrome web browser and type in just wp to be certain that it is defined and then you could try wp.svgPainter in the console and that will show you it is undefined.

    You will then have to debug your code to find out where and why is wp.svgPainter undefined.

Viewing 1 replies (of 1 total)
  • The topic ‘Cannot read property ‘init’ of undefined’ is closed to new replies.