diff --git a/packages/app-backend-core/src/app.ts b/packages/app-backend-core/src/app.ts index 87de3a6fc..44c4f0201 100644 --- a/packages/app-backend-core/src/app.ts +++ b/packages/app-backend-core/src/app.ts @@ -221,6 +221,16 @@ export async function removeApp (app: App, ctx: BackendContext) { } } +// eslint-disable-next-line camelcase +function _legacy_getVueFromApp (app) { + if (app.constructor.name === 'VueComponent') { + // When Vue.extend is used the component is an instance of VueComponent instead of Vue. + // VueComponent has a property super which points to the original Vue constructor + return app.constructor.super + } + return app.constructor +} + // eslint-disable-next-line camelcase export async function _legacy_getAndRegisterApps (ctx: BackendContext) { // Remove apps that are legacy @@ -232,7 +242,7 @@ export async function _legacy_getAndRegisterApps (ctx: BackendContext) { const apps = scan() apps.forEach(app => { - const Vue = app.constructor + const Vue = _legacy_getVueFromApp(app) registerApp({ app, types: {},