ERROR Cannot set headers after they are sent to the client #1510
-
I have an issue where if i reload the page im standing on in my nuxt app it redirects me to the login redirect i declared in my nuxt.config.js. I want to fix this. I've actually fixed it by doing so in my
However this spams my server console with the following:
Commenting out the
it also fixed the reloading, but still produced the same errors EDIT: Adding this to my login redirect works:
|
Beta Was this translation helpful? Give feedback.
Replies: 8 comments
-
Try to use default endpoint property for getting user. Or you have any reasons not to use it? |
Beta Was this translation helpful? Give feedback.
-
Same issue |
Beta Was this translation helpful? Give feedback.
-
I found a temporary fix, adding this to my login redirect page fixes it:
|
Beta Was this translation helpful? Give feedback.
-
Hi @frederikpyt! Can you share your auth config? EDIT: Also the responses of your |
Beta Was this translation helpful? Give feedback.
-
User endpoint response:
Login endpoint response: will provide this tomorrow
|
Beta Was this translation helpful? Give feedback.
-
Thank you, I will see if I can find out what's going on here :) |
Beta Was this translation helpful? Give feedback.
-
I can't seem to find the response of my login endpoint? Any ideas? |
Beta Was this translation helpful? Give feedback.
-
I had the same error. if you are using auth module and fetching the data on initial : Use mounted instead of created
|
Beta Was this translation helpful? Give feedback.
I had the same error.
if you are using auth module and fetching the data on initial : Use mounted instead of created
created() { this.search(); //--> Axios get request },
This will cause Error => Cannot set headers after they are sent to the client.
mounted() { this.search(); //--> Axios get request },
It's OK :)