I'm having some trouble using query selectors in vue.js for finding an element and then performing operations on it. Everything works correctly when I run the project using the local server, but it stops working as expected when I switch to production.
Here's the snippet:
const el_ = document.querySelector(selector);
console.log("Query selected element", el_);
Here's the console output with serve
:
Query selected element <canvas data-v-54b95547 id="c" tabindex="0" resize width="2880" height="610" style="-webkit-user-drag: none; user-select: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);">
Here's the console output with build
:
Query selected element
canvas#c
accessKey: ""
....
virtualKeyboardPolicy: ""
width: 2880
[[Prototype]]: HTMLCanvasElement
The project calls the query selector from a library in the back.
Here are some of the links to the source: