Production handles warnings differently from development
Version
3.2.33
Reproduction link
Steps to reproduce
have a template with a list greater than 1, with length spelled incorrectly, that looks like:
<strong>{{tags[0]}}</strong>
<template v-if="tags.length > 1">
<template v-for="index in (tags.legnth - 1)">
, <strong>{{tags[index]}}</strong>
</template>
</template>
What is expected?
Consistent warning/error handling between environments
What is actually happening?
Development shows no template error, test shows a warning, production hard errors.
Even the playground shows a warning on load, but still renders, would be nice for prod and development to do the same.
We recently had a bug that prevented the page from loading in production.
<template v-for="index in (tags.legnth - 1)">
Obvious failure since length was spelled wrong. What was weird though was that no error or warning showed up in development and the page loads fine. In test, I get
[Vue warn]: The v-for range expect an integer value but got NaN.
but the page still loads fine. And in production, a hard error, page doesn't load. Some consistency would be nice, or at least a way to change the behaviour.
This is the way all Vue warnings have always worked:
- Warnings are shown during dev, and must be fixed before shipping to prod.
- An unhandled warning during dev means it could lead to a hard error during prod.