Closed maral closed 1 year ago
Hi @marai,
What call did you make, that didn't give you that error?
Here's the repo I've used to reproduce the issue.
In any case, I've added 404 for the next release.
So I crossed this issue again and again I forgot the bug is there and lost another hour of my life debugging the strange error. It triggers the same error, regardless what I do. You can reproduce the error anywhere in my repo: https://github.com/maral/catchment-areas
Hi @maral , we've released version 0.22.0 that'll now return a 404 not found error, that should be much clearer.
Check it out at: https://github.com/remult/remult/releases/tag/v0.22.0
Confirming, it returns 404 in API calls from client. From server component (api.withRemult) it works even without registering the entity. Not sure if that is by design, but I don't mind.
I work on a project with a friend and he does not know Remult that well. I forgot to register an entity, and when he tried to use it, it showed this error about 50 times (because with each failed request it made another):
I suppose remult could detect unknown route and put some comprehensible error message, such as
"route /api/something" does not exist, did you forget to register entity "Something"?