Vue 2 → Vue 3
Days Med riskVue 2 reached end-of-life on 2023-12-31. This guide covers the upgrade and the Mushi Mushi pieces.
The Mushi Mushi Vue adapter (mushi-mushi/vue) supports Vue 3.3 and later
(its peer dependency is vue >=3.3). Apps still on Vue 2 use the plain
mushi-mushi web SDK; this guide brings you onto the adapter.
Vue 2 is no longer receiving security patches. The Vue team’s official recommendation is to migrate. If you cannot, HeroDevs ships a paid LTS for Vue 2.7 with security backports.
What changes (high level)
new Vue({...}).$mount(...)→createApp(App).mount(...)- Options API still works in Vue 3, but the Composition API is the recommended style. You can mix both during the migration.
- Filters are gone. Methods or computed properties replace them.
- Functional components are plain functions in Vue 3; the
functionaloption and<template functional>are gone. v-modelon a custom component changed semantics; see the Vue 3 migration guide .- Vue Router 3 → 4. Vuex 3 → 4 (or Pinia, recommended).
- Mushi Mushi:
mushi-mushidirect usage →mushi-mushi/vueadapter.
API mapping (Mushi Mushi)
Vue 2 (with mushi-mushi) | Vue 3 (with mushi-mushi/vue) |
|---|---|
Mushi.init({ projectId, apiKey }) in main.js | app.use(MushiPlugin, { projectId, apiKey }) only; the plugin calls Mushi.init() itself |
Manually attach Vue.config.errorHandler = ... to forward to Mushi Mushi | The adapter chains onto Vue 3’s app.config.errorHandler automatically |
Use the instance from Mushi.init() in components | Use the useMushi() composable inside <script setup> / setup() |
Migration checklist
- Step 01Run vue-compat (the bridge build)
- Step 02Fix every Vue 2-style deprecation warning
- Step 03Remove @vue/compat alias once warnings are zero
- Step 04Upgrade Vue Router 3 → 4
- Step 05Decide: Vuex 4 or Pinia
- Step 06Install the Mushi Mushi Vue adapter
- Step 07Replace direct Mushi.init usage with the adapter
- Step 08Migrate components to useMushi()
- Step 09Remove any Vue-2-era Mushi Mushi error-handler shims
- Step 10Smoke-test: throw an error, verify it lands as a Mushi Mushi report
Common gotchas
- Calling
Mushi.init()as well asapp.use(MushiPlugin, ...). Since@mushi-mushi/vue1.0 the plugin initialises the SDK itself; a secondMushi.init()only logs “Already initialized”. Remove it. <script setup>and Options API mixing. Both work in Vue 3, butuseMushi()is a composable, so call it insidesetup()/<script setup>. In an Options API component, add asetup()option that returns it, or useMushi.getInstance()frommushi-mushi.- Stale Vue 2 plugins. Check each Vue plugin you use (error reporting, logging, UI kits) for a Vue 3 version.
Mushi Mushi during the migration
You can run just mushi-mushi (no /vue import) in compat mode and it works. The
adapter is purely additive: it gives you a nicer composable API and
auto-wires the error handler. Migrate Mushi Mushi to the adapter only after
your app is on real Vue 3 (compat alias removed).