• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

264
Views
Query Selectors not working correctly in vue.js for production

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:

  • Repo Info: https://github.com/CIDARLAB/3DuF/tree/webpack-build (you can just build and see the errors on load)
  • Exact location of code: https://github.com/CIDARLAB/3DuF/blob/98d0563796206a0961ea0c9be4fe16687429b89c/src/app/utils/htmlUtils.ts#L13
about 3 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error