Static GitHub Issues

[593] redirect cause Error: Can't set headers after they are sent.

prev: 0.10.6 break asyncData & this.$router.push
next: Add transition to elements in a page on page-leave and page-enter

Hi!

I have index.vue page like this:

<script>
  export default {
    fetch ({ redirect }) {
      return redirect('/catalog/')
    }
  }
</script>

When user click http://127.0.0.1/ there is a warning in the logs:

(node:7580) UnhandledPromiseRejectionWarning: 
Unhandled promise rejection (rejection id: 16): Error: Can't set headers after they are sent.

But when access http://127.0.0.1/catalog directly everything is ok.

Am I doing redirect in a incorrect way?

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c515">#c515</a>)</em></sub></div>