Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'. #489

Closed
NathHorrigan opened this issue May 7, 2017 · 7 comments

Comments

@NathHorrigan
Copy link

I am using OverlayView to create custom markers. The markers are loading but I have the following error: Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'. This error has occurred before in #461 but the solution doesn't apply in my case.

@inject("map") @observer
export default class MarkerBuilder extends Component {

    constructor(props) {
        super(props);
    }

    render() {
        return (
            <div>
                {
                    this.props.map.markers.map((marker) => (
                        <OverlayView
                            mapPaneName={OverlayView.OVERLAY_MOUSE_TARGET}
                            getPixelPositionOffset={(width, height) => {
                                return { x: -(width / 2), y: -(height / 2) };
                            }}
                            key={marker.id}
                            position={{ lat: marker.location.lat, lng: marker.location.lng }}
                            onClick={() => this.props.map.triggerDrawer(marker)}>

                                 <Marker/>

                        </OverlayView>
                    ))
                }
            </div>

        )
    }

}
@vozni4iy
Copy link

File OverlayView.js , lines 129and 130

helpers.mountContainerElementToPane(mapPanes, this._containerElement, props);
helpers.renderChildToContainerElement(mapCanvasProjection, this._containerElement, props);

should be changed to

if (this._containerElement) {
      helpers.mountContainerElementToPane(mapPanes, this._containerElement, props);
      helpers.renderChildToContainerElement(mapCanvasProjection, this._containerElement, props);
    }

It is a library bug, I think.

@tomchentw
Copy link
Owner

Not sure why, but this should no longer be a problem in v8.0.0.
https://tomchentw.github.io/react-google-maps/#!/OverlayView

@gomezgoiri
Copy link

gomezgoiri commented Oct 11, 2017

I'm still experiencing this problem in v8.4.1...

Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.
    at OverlayView.draw (OverlayView.js:142)
    at wrapper (_createBind.js:23)
    at _baseDelay.js:18

this.containerElement is undefined in mapPanes[mapPaneName].appendChild(this.containerElement)

@erfoon
Copy link

erfoon commented Oct 15, 2017

Same problem as @gomezgoiri mentioned in 8.3.0
I used OverView several times and had no problem. But this time there is no way to avoid this error.

@tomchentw
Copy link
Owner

@gomezgoiri @erfansamieyan could you post a minimal reproducible repository to demo the problem? It really doesn't help to just complain it here as I cannot reproduce

@gomezgoiri
Copy link

I understand. I'll do my best trying to isolate this error.

@quachsimon
Copy link

quachsimon commented Dec 4, 2017

I'm on v9.4.1 and am also receiving this error.
I'm doing something like so where I have a div inside the OverlayView

<OverlayView
    mapPaneName={OverlayView.OVERLAY_MOUSE_TARGET}
    getPixelPositionOffset={getPixelPositionOffset}
    ...
>
    <div>
        Some content here
    </div>
</OverlayView>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants