diff --git a/src/wp-includes/js/wp-util.js b/src/wp-includes/js/wp-util.js
index 84cb551..a703a85 100644
--- a/src/wp-includes/js/wp-util.js
+++ b/src/wp-includes/js/wp-util.js
@@ -30,6 +30,9 @@ window.wp = window.wp || {};
 			};
 
 		return function ( data ) {
+			if ( ! document.getElementById( 'tmpl-' + id ) ) {
+				throw new Error( 'Template not found: ' + '#tmpl-' + id );
+			}
 			compiled = compiled || _.template( $( '#tmpl-' + id ).html(), null, options );
 			return compiled( data );
 		};
