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

InfoWindow with slot gives insertBefore TypeError errors. #87

Closed
ValiDrv opened this issue Jun 24, 2022 · 8 comments · Fixed by #88
Closed

InfoWindow with slot gives insertBefore TypeError errors. #87

ValiDrv opened this issue Jun 24, 2022 · 8 comments · Fixed by #88
Labels
bug Something isn't working

Comments

@ValiDrv
Copy link

ValiDrv commented Jun 24, 2022

There seems to be an issue with removing components that use <slot />

This will work:

<InfoWindow v-if="open" :options="{ position: openedMarker.position }, content: 'Hello World!' }"  @closeclick="open = !open"/>

This will give errors:

<InfoWindow v-if="open" :options="{ position: openedMarker.position"  @closeclick="open = !open">
Hello World!
</InfoWindow>

Errors:

vue.cjs.js:11319 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'insertBefore')
    at insert (vue.cjs.js:11319:16)
    at processCommentNode (vue.cjs.js:8451:13)
    at patch (vue.cjs.js:8403:17)
    at patchBlockChildren (vue.cjs.js:8727:13)
    at processFragment (vue.cjs.js:8789:17)
    at patch (vue.cjs.js:8414:17)
    at patchBlockChildren (vue.cjs.js:8727:13)
    at patchElement (vue.cjs.js:8635:13)
    at processElement (vue.cjs.js:8501:13)
    at patch (vue.cjs.js:8418:21)

Seems to be the case for CustomMarker also (gives the error when computed

This works: <Marker v-for="m of markers" :options="m.options" :key="m.id">...</Marker>
This gives errors: <CustomMarker v-for="m of markers" :options="m.options" :key="m.id">...</CustomMarker>

@HusamElbashir
Copy link
Collaborator

Hey @ValiDrv

Can you share a minimal reproduction? You can use vite.new/vue

@tlhunter
Copy link

@ValiDrv does this look like it might be the same as #85?

@ValiDrv
Copy link
Author

ValiDrv commented Jun 25, 2022

Looks like it, but I didn't try that area l array push pop, I had it with a computed property that returned an array, or an object.

I'll make some test cases for you tomorrow. ( Just to make sure it's not related to vite )

@ValiDrv
Copy link
Author

ValiDrv commented Jun 25, 2022

Here is a test project:

https://stackblitz.com/edit/vitejs-vite-wfqrqh?file=src/App.vue

What I found, is that if you close the InfoWindow via it's X button AND you have MarkerCluster/CustomMarkers/Marker on the map, you get that error.

If you use vue to show/hide it using v-if, then it doesn't give the error.

The same error happens "randomly" (didn't pinpoint the cause) when we redraw CustomMarkers (zoom in/out or pan the window)

@HusamElbashir
Copy link
Collaborator

Tentatively labeling this as a bug until I can take a closer look

@HusamElbashir HusamElbashir added bug Something isn't working and removed pending triage labels Jun 25, 2022
@tlhunter
Copy link

The same error happens "randomly" (didn't pinpoint the cause) when we redraw CustomMarkers (zoom in/out or pan the window)

This sounds a lot like what I'm seeing in #85. I suspect these two issues may have the same root cause.

@HusamElbashir
Copy link
Collaborator

This should be fixed in v0.13.1. Let me know if the issue persists or if you encounter other issues.

@ValiDrv
Copy link
Author

ValiDrv commented Jun 28, 2022

In preliminary tests it looks like it's working, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants