Skip to content

ERROR TypeError: Cannot read properties of null (reading 'remove') with multiple Swipers in Angular #8129

@mbe-comspace

Description

@mbe-comspace

Check that this is really a bug

  • I confirm

Reproduction link

n/a

Bug description

We are using Swiper with Angular 30.3.2 and are getting the following console errors when we have multiple Swipers on one page while navigation & scrollbar are deactivated:

ERROR TypeError: Cannot read properties of null (reading 'remove')

Investigation showed errors come from update-swiper.mjs lines 94 &103, it seems there the remove method is called on noexisting elements.

This does not prevent the Swipers from functioning properly, the errors are just irritating and should not be there.

Expected Behavior

No errors are shown in the console while running multiple Swipers at the same time while navigation or pagination is turned off.

Actual Behavior

Errors are shown in the console while running multiple Swipers at the same time while navigation or pagination is turned off.

Swiper version

12.0.2 / 12.0.3

Platform/Target and Browser Versions

Chrome, Ubuntu & Windows

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
  • Make sure this is a Swiper issue and not a framework-specific issue

Would you like to open a PR for this bug?

  • I'm willing to open a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions