vue.jsvuejs3here-api

Vue 3, HERE Maps: Failed to execute 'postMessage' on 'Worker': [object Array] could not be cloned


So we are migrating our code base from Vue 2 to Vue 3 and everything works fine for HERE maps except for the .addObject() event that keeps failing with the error:

Failed to execute 'postMessage' on 'Worker': [object Array] could not be cloned

Nothing else has been changed and the data exists and is properly formatted.

Any help would be appreciated!


Solution

  • It turns out that Vue 3 uses Proxy and because of this, HERE maps throws a fit.

    To fix this I used: toRaw() and wrapped the data inside of this! This fixed the issue.

    Docs: https://vuejs.org/api/reactivity-advanced.html#toraw