Help debugging - illegal invocation rejection - nuxt hub
Hello
Yesterday while starting my project in dev, I got "illegal invocation" error from Nitro and so far I was unable to identify the issue or do a reproduction.
I need help identifying the issue please.
Here is the message I'm having in the terminal :
It seems to happen when an /api/ route is requested. On the frontend it throws a 404 in the javascript console.
By checking my commit history, I was also not able to identify anything meaningful around that date. I did update dependencies, but reversing that update or reproducing such update on an empty project did nothing.
8 Replies
I'm having the same issue and have not been able to find a fix... anyone? 🙏
Same issue, been struggling to solve this whole day. In my case, I can call the api route fine if there is no problem with my nuxt hub DB, but if there i some problem with DB (like invalid sql, or empty not nullable value, or even if I use
throw createError
this error ocurs.It might be due to invalid routeRules in nuzt.config, try commenting them out and see if that fixes it for you, it somehow did for me, though not sure what was invalid
no routeRules for me in nuxt.config :/ it's clearly a problem on dev/localhost. Everything is working ok on production
are you guys using
compatibilityVersion: 4
in nuxt.config?I wasn't. But I rebuilt the project entirely with compat 4 this weekend so I could review my code the hard way and deploy differently.
I don't have that bug now... but last time I didn't have the bug until I had it.
I tried rebuilding the project from scratch also, but did not help. Then I restarted my PC, and the problem is gone . I am happy, but as you said, this can repeat in fututre.
did it eventually happen after you updated packages ?
I just came back on another project using nuxt hub and did pnpm up
It gave me the illegal invocation right after
For people having this problem, the issue comes from recent changes in
wrangler
package, lock its version to 3.63.0
as a workaround in your package.json
dependencies and the issue should be gone for now
[unhandledRejection] Illegal invocation
error seems to happen in dev only