Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vue3: $emit in mounted in new app results in TypeError: Cannot read property 'id' of undefined (timeline.js) #1459

Closed
ChristianBirkl opened this issue May 28, 2021 · 0 comments
Labels

Comments

@ChristianBirkl
Copy link

Version

6.0.0-beta.11

Browser and OS info

Chrome 90 / Windows10

Steps to reproduce

create a new vue app with the following component:

<template>
  <div id="compA"></div>
  <input type="button" @click="createApp" value="+app" />
</template>
<script lang="ts">
import { defineComponent, createApp } from 'vue'

import CompA from "./components/CompA.vue";

export default defineComponent({
  methods: {
    createApp() {
      createApp(CompA).mount("#compA");
    }
  }
})
</script>

CompA.vue:

<template>
    <div></div>
</template>
<script lang="ts">
import { defineComponent } from 'vue'
export default defineComponent({
    mounted() {
        this.$emit("foo", "bar");
    }

})
</script>

Steps:

  1. click +app

What is expected?

No error :-D

What is actually happening?

timeline.js:57 Uncaught (in promise) TypeError: Cannot read property 'id' of undefined
    at Object.<anonymous> (timeline.js:57)
    at Object.emit (<anonymous>:70:28)
    at devtoolsComponentEmit (runtime-core.esm-bundler.js:596)
    at emit (runtime-core.esm-bundler.js:969)
    at Configuration2.config.emitOptionChanged [as _emitOptionChanged] (configuration.js:271)
    at Configuration2._tryEmitOptionChanged (configuration.js:242)
    at Configuration2._onOptionChanged (configuration.js:228)
    at Configuration2.onOptionChanged (configuration.js:158)
    at Object.<anonymous> (component.js:136)
    at Object.Callback._fireCore (callbacks.js:25)

source:

global_hook_1.hook.on(shared_utils_1.HookEvents.COMPONENT_EMIT, async (app, instance, event, params) => {
    const appRecord = app_1.getAppRecord(app, ctx);

appRecord is undefined in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants