You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is that returning null doesn't work as NextJS seems to be hanging forever. So I have to return a valid JSON, even if empty. If I do this, the problem is that I'm tying this to all requests that use this fetcher and they might not expect the same object.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
My API returns HTTP 204 on a bunch of occasions. This type of request doesn't have a body.
For example, if I do a
GET
request of entities and there are no entities, it returns204
. What should I do in this case?Here's what I tried:
The problem is that returning
null
doesn't work as NextJS seems to be hanging forever. So I have to return a valid JSON, even if empty. If I do this, the problem is that I'm tying this to all requests that use this fetcher and they might not expect the same object.What should I do?
Beta Was this translation helpful? Give feedback.
All reactions