Skip to content

Unproper warning thrown with event handler invoke with async error handling #9419

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

Closed
AlexandreBonaventure opened this issue Feb 4, 2019 · 1 comment

Comments

@AlexandreBonaventure
Copy link

Version

2.6.0

Reproduction link

https://jsfiddle.net/jk8as0bz/

Steps to reproduce

NB: use a component with a transpiled render function (render._withStripped should be true). For the purpose of the minimal repro, we are setting the flag manually.

on the minimal repro open the console, click on the button and see the warning message showing up

What is expected?

no warning

What is actually happening?

it throws an improper warning


What is happening

  1. create a component that $emit directly in an event handler like <button @click="$emit('click')">click me! </button>
  2. The handler will be compiled as such in the createElement function
on: {
                click: function($event) {
                  return _vm.$emit("closeModal")
                }
}

returning the vm instance
3. In the isPromise call it will check for property like .then or .catch
4. the withStriped flag set to true the vm instance is proxied to throw non present properties but referenced during render on development
5. It will throw the following warning: [Vue warn]: Property or method "then" is not defined on the instance but referenced during render

@AlexandreBonaventure
Copy link
Author

Ho someone just reported the bug 15 minutes before. #9418
sorry for the duplicate

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

No branches or pull requests

2 participants