AdvancedCustomFields / AdvancedCustomFields/acf

"jsx => true" causes error when adjusting repeater field. "DOMException: Node.removeChild: The node to be removed is not a child of this node"

Open
#397 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
945
Forks
197
PR merge metrics
No merged PRs in 30d

Description

I've run into an issue where enabling 'jsx' => true support breaks a block preview in the admin if I add or remove a row from a repeater field that is connected to JS (Specifically in this case the Slick Carousel JS).

I am able to replicate using the block example from the 'building a custom slider in 30 minutes' blog post. (https://www.advancedcustomfields.com/blog/building-a-custom-slider-block-in-30-minutes-with-acf/)

It works as intended without 'jsx' => true support, but as soon as I add that into the acf_register_block_type() function and try and add or remove slides it breaks the entire block preview and the page needs to be refreshed to see the block again.

The console provides the following error message DOMException: Node.removeChild: The node to be removed is not a child of this node

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the custom slider block example from the linked ACF blog post and the acf_register_block_type() call where 'jsx' => true is enabled. Reproduce adding and removing rows in the Slick Carousel-connected repeater, then trace the admin block preview around the reported Node.removeChild DOMException; done means row changes no longer break the preview.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, php, wordpress
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.