AlexLavoie42 / Nuxt-Mapbox

Elegant Mapbox integration with Nuxt
81 stars 11 forks source link

error on second navigateto #43

Closed agracia-foticos closed 1 year ago

agracia-foticos commented 1 year ago

We have this reproduction link:

https://stackblitz.com/edit/nuxt-starter-hjvw8o

If you navigate through the links, first navigateTo runs, but the second fails:

I remove nuxt-mapbox and runs

Error in console: chunk-MNWBZQKJ.js:82 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'parentNode') at parentNode (chunk-MNWBZQKJ.js:82:30) at ReactiveEffect.componentUpdateFn [as fn] (chunk-3Q27KRJ5.js:5823:11) at ReactiveEffect.run (reactivity.esm-bundler.js:178:19) at instance.update (chunk-3Q27KRJ5.js:5860:52) at updateComponent (chunk-3Q27KRJ5.js:5687:18) at processComponent (chunk-3Q27KRJ5.js:5622:7) at patch (chunk-3Q27KRJ5.js:5084:11) at sharedContext.activate (chunk-3Q27KRJ5.js:2485:7) at processComponent (chunk-3Q27KRJ5.js:5603:29) at patch (chunk-3Q27KRJ5.js:5084:11) parentNode @ chunk-MNWBZQKJ.js:82 componentUpdateFn @ chunk-3Q27KRJ5.js:5823 run @ reactivity.esm-bundler.js:178 instance.update @ chunk-3Q27KRJ5.js:5860 updateComponent @ chunk-3Q27KRJ5.js:5687 processComponent @ chunk-3Q27KRJ5.js:5622 patch @ chunk-3Q27KRJ5.js:5084 sharedContext.activate @ chunk-3Q27KRJ5.js:2485 processComponent @ chunk-3Q27KRJ5.js:5603 patch @ chunk-3Q27KRJ5.js:5084 patchSuspense @ chunk-3Q27KRJ5.js:1326 process @ chunk-3Q27KRJ5.js:1129 patch @ chunk-3Q27KRJ5.js:5109 componentUpdateFn @ chunk-3Q27KRJ5.js:5819 run @ reactivity.esm-bundler.js:178 instance.update @ chunk-3Q27KRJ5.js:5860 updateComponent @ chunk-3Q27KRJ5.js:5687 processComponent @ chunk-3Q27KRJ5.js:5622 patch @ chunk-3Q27KRJ5.js:5084 componentUpdateFn @ chunk-3Q27KRJ5.js:5819 run @ reactivity.esm-bundler.js:178 instance.update @ chunk-3Q27KRJ5.js:5860 callWithErrorHandling @ chunk-3Q27KRJ5.js:213 flushJobs @ chunk-3Q27KRJ5.js:411 image

agracia-foticos commented 1 year ago

i put keepalive : false and runs :( but we lost SPA funcionality

AlexLavoie42 commented 1 year ago

Setting keepalive to false will not have any effect, so if you need to have it disabled be sure to use persistent in mapbox settings instead

AlexLavoie42 commented 1 year ago

I believe this is either a bug in nuxt itself, or in your implementation. Removing the module and setting keepalive to true has the same issue.