error after destroy

voss's Avatar


07 Nov, 2019 07:18 PM


we build sliders for responsive layout:

The sliders are destroyed and re-initialized with new dom (1/2/4 bottles per slide) on mediaquery breakpoints. We get JS errors when resizing the browser window from small to wide an vice versa (FF: a.slides is null ..., CH: Uncaught TypeError: Cannot read property 'append' of null ...),

Do you have any suggestion for catching the errors?

Best regards

The original non-responsive version is here:

  1. Support Staff 1 Posted by Dmitry Semenov on 07 Nov, 2019 09:08 PM

    Dmitry Semenov's Avatar


    Destroying the slider does not restore it to the initial markup, it only cleans up events and timers. So when initializing second time, make sure that markup is restored.

    Also, try to debounce or throttle reinitialization, so it does not occur too frequently.

  2. 2 Posted by voss on 08 Nov, 2019 10:13 AM

    voss's Avatar

    the initial markup is restored. With throttled reinitialization the errors occur less often. Is there async code in rs?

  3. Support Staff 3 Posted by Dmitry Semenov on 09 Nov, 2019 05:03 AM

    Dmitry Semenov's Avatar

    There is a lot of async code in rs. However, most is cleared at destroy().

    If you won't be able to resolve with debounce - please post JS code for your slider, so I can debug it on my side.

  4. 4 Posted by voss on 11 Nov, 2019 10:23 AM

    voss's Avatar


    thank you. For the moment we can live with these rare errors.

    Mit freundlichen Grüßen
    Dr. Joachim Voß
    Scientec Internet Applications + Media GmbH
    Grandkuhlenweg 14
    D-22549 Hamburg
    Tel.: (040) 8400 2431
    Fax.: (040) 8400 2432
    E-Mail: [email blocked]
    Registergericht/-nummer: Amtsgericht Hamburg / HRB 77480
    USt-IdNr.: DE212450878
    Geschäftsführer: Dr. Jan Friedrich, Dr. Joachim Voß

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac