[javascript] Error: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'