Skip to content
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

Trying to log with console.error generates invalid JSON (wrapped in consola?) #8741

Closed
gkatsanos opened this issue Feb 1, 2021 · 2 comments

Comments

@gkatsanos
Copy link

gkatsanos commented Feb 1, 2021

  $axios.onError((error) => {
    console.log({
      date: new Date().toISOString(),
      level: "error",
      message: error.message,
      error: { stack: error.stack, message: error.message }
    })
    app.$sentry.withScope((scope) => {
      scope.setExtra('route', route)
      app.$sentry.captureException(error)
    })
  })

returns [ERROR] { ... } instead of simply { date: 1/02/2021 , level: "error", "message": "404 not found" }

@gkatsanos gkatsanos changed the title All console logs are wrapped in consola and produce invalid JSON Trying to log with console.error generates invalid JSON (wrapped in consola?) Feb 1, 2021
@pi0
Copy link
Member

pi0 commented Feb 1, 2021

Hi @gkatsanos. I've filled bug report unjs/consola#109 for consola. Meanwhile you can use provided workarounds :)

@pi0
Copy link
Member

pi0 commented Feb 2, 2021

Issue fixed in consola@2.15.1. For fix you can use yarn upgrade nuxt or better recreating lock file.

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

No branches or pull requests

3 participants