Skip to content

Does not work with createSSRApp #1376

Closed
@danelowe

Description

@danelowe

Version

6.0.0-beta.7

Browser and OS info

Firefox 86.0 / macOS 11.1

Steps to reproduce

Download https://github.com/vitejs/vite.git and cd to packages/playground/ssr-vue

run npm i vite, then npm run dev. Open localhost:3000 in browser and try to use vue-devtools.

What is expected?

Vue devtools shows an app running on localhost:3000

What is actually happening?

Vue devtools shows 'No App' in the app selector.

Errors in console:

Uncaught (in promise) TypeError: record.rootInstance is null
    registerAppJob moz-extension://a954018d-dafd-ae48-aeca-7157f39e6cca/build/backend.js:1437
    registerApp moz-extension://a954018d-dafd-ae48-aeca-7157f39e6cca/build/backend.js:1403
    run moz-extension://a954018d-dafd-ae48-aeca-7157f39e6cca/build/backend.js:4373
    queue moz-extension://a954018d-dafd-ae48-aeca-7157f39e6cca/build/backend.js:4379

If you open up main.js in the example project and change the code to use createApp, devtools will work.

import App from './App.vue'
import { createApp as _createApp } from 'vue'
import { createRouter } from './router'

// SSR requires a fresh app instance per request, therefore we export a function
// that creates a fresh app instance. If using Vuex, we'd also be creating a
// fresh store here.
export function createApp() {
  const app = _createApp(App)
  const router = createRouter()
  app.use(router)
  return { app, router }
}

There are mentions of this at #1289, but that issue seemed to have been closed due to a flood of comments from people using Vue 2.

This issue is also present when using chrome, and when using standalone vue-devtools app.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions