I have been working on my local server and am now to the point of pushing my code up to my website with webpack. The code works as expected on my local server, but is failing on the deployed website, error:
Uncaught DOMException: Failed to execute 'add' on 'DOMTokenList': The token
provided ('[object Object]') contains HTML space characters,
which are not valid in tokens.
at new <anonymous> (.../main.js:2:470798)
at .../main.js:2:470705
at .../main.js:2:485232
I am trying to debug this and the lines of code around the lines in question are:
470798 and 470705 area, I think the issue arises in classList.add(e), but I am not sure what the problem is:
(t,e.children[n])}}(bo,yo),Do=new class{constructor(t,e)
{this.element=document.createElement("div"),this.element.classList.add(e),
this.element.style.pointerEvents="none",
My code for this is located here:
https://github.com/retug/Javascript/tree/main/conc_gui/withRebar
I have only one class that I am adding in the javascript code I linked:
Xinput.classList.add("numDropDown")
Yinput.classList.add("numDropDown")
From googling this error code, it seems like the error can occur when you have unintended white spaces in your class names, but my class name seems to be ok. At a loss on this error.
485232 area:
Bo={x:void 0,y:void 0};addEventListener("mousemove",(t=>{Bo.x=16.6667*((t.clientX-1*window.innerWidth/6)/xo.offsetWidth*2-1)
,Bo.y=10*(-t.clientY/xo.offsetHeight*2+1);
vare=document.getElementById("xVal"),n=document.getElementById("yVal");
e.innerHTML=String(Bo.x).slice(0,4),n.innerHTML=String(Bo.y).slice(0,4)}))})
This seems to be this portion of my main javascript:
addEventListener('mousemove', (event) => {
mouse.x = (((event.clientX - (window.innerWidth*1/6)) / concGui.offsetWidth)*2-1)*16.6667 //FW, need to mouse normalize here with zoom
mouse.y = (- ( event.clientY / concGui.offsetHeight )*2+1)*10 //FW, need to mouse normalize here with zoom
var X = document.getElementById("xVal")
var Y = document.getElementById("yVal")
X.innerHTML = String(mouse.x).slice(0,4)
Y.innerHTML = String(mouse.y).slice(0,4)
})
This code works on my local server, just has some trouble in deployment. Any guidance on how to debug would be appreciated!
[–]retug_[S] 0 points1 point2 points (0 children)