Skip to content

"Unhandled Runtime Error NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node." AuthForm - when button has "isLoading={true}" #9

Description

@Pmejna

Unhandled Runtime Error : "NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node. Caused by Button in the AuthForm component

Error shows up when button attribute isLoading={isLoading} , and we click the button text content then (setLoading is triggered and spinner should showup in place of a text node):

<Button
   type="submit"
   bg="green.500"
   isLoading={isLoading}
   sx={{
     '&:hover': {
        bg: 'green.300',
     },
   }}
>
  {mode}
</Button>
  • Generate the same error,
 <Button 
    type="submit" 
    bg="green.600" 
    isLoading={isLoading}
    loadingText="loading..."
    sx={{
        "&:hover": {
            bg: "green.400"
        }
    }}
 >
        Submit
</Button>

No errors with:

  • Button works correctly when we click area outside the button text.
  • The lack of the text as a child doesn't produce any errors:
 <Button 
    type="submit" 
    bg="green.600" 
    isLoading={isLoading}
    loadingText="loading..."
    sx={{
        "&:hover": {
            bg: "green.400"
        }
    }}
 >
</Button>
  • The button doesn't cause an error when a child is another react component (not a text node):
 <Button 
    type="submit" 
    bg="green.600" 
    isLoading={isLoading}
    loadingText="loading..."
    sx={{
        "&:hover": {
            bg: "green.400"
        }
    }}
 >
        <Text>{mode}</Text>
</Button>
  • no issues when isLoading is set to false

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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