Uncaught DOMException: Failed to execute 'querySelectorAll' on 'Document': '[object HTMLDocument]' is not a valid selector.
this is my code in main.js file.
require([ 'rellax'], function ($) {
$(document).ready(function () {
console.log("entered the function rellax");
var rellax = new Rellax('.rellax', {
callback: function (position) {
console.log(position);
}
});
});
});
This is my requirejs-config.js
var config = {
deps: [
"js/main"
],
map: {
'*': {
slick: 'js/slick.min',
rellax: 'js/rellax.min'
}
},
};
domReady!
as a dependency rather than using the jQuery .ready method. 2. What happens if you remove the rellax code and dependency? That can narrow it down to either rellax itself or whether it's how you've added the JS.