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
Feature Request: Better error message #380
Comments
Not really. The main object is a default export. So in general you can do import Line from 'vue-chartjs' It is not wrong per se. Because default exports can be named how you like it. However if you You then can access it over the import Line form 'vue-chartjs'
export default {
extends: Line.Line
} would be perfectly fine. There is also no way that I can produce error messages if someone is trying to mount a wrong component or object. Because this is all handled by vue.js If you encounter this kind of error messages it is always good to |
Hi, Thanks for the quick response. You're saying the error comes from Vue, which is correct, but I'm saying it I don't think it has to (and would help catch mistakes for Vue noobs like myself).
|
Well this would work. However I would never Even if you Because the you extend your own components with the charts. Either over So in the end you would have 3 or 4 additional error messages and the important one from the fake render function would be the first one any may be unseen due to the other error messages. So I am not really sure if it is worth it. Maybe some other people would share their thoughts on this. 👐 |
I know alert sounds weird, but it is useful for something that's more like a compile-time error than a runtime error... it only happens if the programmer really screws up, and there's no missing it. Plenty of other projects use it that way. Even if you did go with console.log instead, at least the message would tell you exactly what was wrong. I have no idea how many people run into this kind of error... maybe it's just me 😄 |
Hi,
I just spent a while debugging this error:
Failed to mount component: template or render function not defined.
It turns out I'd written
import Line from 'vue-chartjs';
instead ofimport { Line } from 'vue-chartjs';
Would it be possible to have a better error message for this? Maybe by adding a
render()
method to the main exported object?The text was updated successfully, but these errors were encountered: