Exception is thrown when jQuery calls this function
/**
* The ready event handler and self cleanup method
*/
function completed() {
document.removeEventListener( "DOMContentLoaded", completed, false );
window.removeEventListener( "load", completed, false );
jQuery.ready();
}
In this case the compiled function is called but not native method and the first argument is "load" instead of DOM node.
The advised solution is to wrap all code generated by the compiler to a self invoked function and avoid rewriting of window.removeEventListener() method.
When both Svelte and jQuery are included on the page there is an exception "Uncaught TypeError: node.removeEventListener is not a function"
The issue is caused by this function that is generated in the global namespace and rewrites a method of a
window
objectException is thrown when jQuery calls this function
In this case the compiled function is called but not native method and the first argument is "load" instead of DOM node. The advised solution is to wrap all code generated by the compiler to a self invoked function and avoid rewriting of
window.removeEventListener()
method.