Skip to content

Commit

Permalink
fix: improve error message when client/server out-of-sync
Browse files Browse the repository at this point in the history
  • Loading branch information
brillout committed Feb 9, 2023
1 parent 0d6c3a4 commit 21fb6ed
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions telefunc/client/remoteTelefunctionCall/makeHttpRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,11 @@ async function makeHttpRequest(callContext: {
callContext
})
)
/* With Next.js 12: when renaming a `.telefunc.js` file the client makes a request with the new `.telefunc.js` name while the server is still serving the old `.telefunc.js` name. Seems like a race condition: trying again seems to fix the error.
// This should never happen as the Telefunc Client shouldn't make invalid requests
assert(false)
*/
assertUsage(false, 'Try again. You may need to reload the page. (The client and server are/was out-of-sync.)')
} else {
assertUsage(
statusCode !== 404,
Expand Down

0 comments on commit 21fb6ed

Please sign in to comment.