diff --git a/src/platforms/web/compiler/index.js b/src/platforms/web/compiler/index.js
index <HASH>..<HASH> 100644
--- a/src/platforms/web/compiler/index.js
+++ b/src/platforms/web/compiler/index.js
@@ -58,6 +58,8 @@ export function compile (
   })
   if (process.env.NODE_ENV !== 'production') {
     compiled.errors = errors.concat(detectErrors(compiled.ast))
+  } else {
+    compiled.errors = errors
   }
   return compiled
 }
ensure errors Array is always present in compiler output