]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
refactor: use console.error during lazy loading (#777)
authorCristian Pallarés <cristian@pallares.io>
Thu, 18 Feb 2021 17:04:31 +0000 (18:04 +0100)
committerGitHub <noreply@github.com>
Thu, 18 Feb 2021 17:04:31 +0000 (18:04 +0100)
By using `console.error` even in the development environment, we will provide useful information such as the reference to the actual ES module that failed and the code line where it happened

src/navigationGuards.ts

index c7a872d15826d7a0be488d6a486a9ce212e39024..185a22f21603dbf77ca7cfda1981f00f57d64a6f 100644 (file)
@@ -298,9 +298,7 @@ export function extractComponentsGuards(
           componentPromise = Promise.resolve(componentPromise as RouteComponent)
         } else {
           // display the error if any
-          componentPromise = componentPromise.catch(
-            __DEV__ ? err => err && warn(err) : console.error
-          )
+          componentPromise = componentPromise.catch(console.error)
         }
 
         guards.push(() =>