Home

Issue: 593

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

[issue link]

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?

This question is available on Nuxt.js community (#c515)