Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

271
Views
Vue Silentbox Cannot set properties of undefined (setting '$silentbox')

I have set up Silentbox in my project from the official documentation. and I am getting some errors..enter image description here

here is the function:

 Vue.prototype.$silentbox = {
    /**
     * Programatically open SilentBox overlay.
     *
     * @param {Object} image
     */
    open: image => {
      const OverlayClass = Vue.extend(__vue_component__);
      const instance = new OverlayClass().$mount();
      instance.$set(instance, 'visible', true);
      instance.$set(instance, 'overlayItem', image); // Get the website body, so we can append false silentbox root to it later

      const bodyRoot = document.getElementsByTagName('body')[0]; // Create false silentbox root

      const silentboxRoot = document.createElement('div'); // Set ID to false silentbox root, so we can target it in some cases

      silentboxRoot.setAttribute('id', 'silentbox--false-root'); // Register the elements

      silentboxRoot.appendChild(instance.$el);
      bodyRoot.appendChild(silentboxRoot);
      instance.$on('closeSilentboxOverlay', () => {
        // Remove and destroy the instance after closing.
        silentboxRoot.remove();
        instance.$destroy();
      });
    }
  };
about 4 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 Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!