Closed agenio closed 4 months ago
Branch issue-22-Session-state-threw-an-exception created!
@agenio - sorry about that, I will take a look. Probably related to recent changes I made.
Don't worry it's part of the job.
I found a possible fix, i changed:
export default { fetch: router.handle, };
to
export default router;
into index.ts (session-state package) and now the exception isn't threw and session management works
Yeah it's due to this issue:
https://itty.dev/itty-router/guides/cloudflare-workers https://github.com/cloudflare/workers-sdk/issues/5420
I'm about to push a fix (which includes some other code cleanup and refactoring to better align with the other packages.
Fix for this and some refactoring and improvements pushed and PR'ed to main. Thanks!
Hello,
i'm trying to use your awesome project to manage users into a my project. I have an issue with the session-state worker that continue to threw this exeception:
{ "truncated": false, "outcome": "exception", "scriptVersion": { "id": "c9960f47-24a5-4932-9e5c-4edf4a796bfe" }, "scriptName": "session-state", "diagnosticsChannelEvents": [], "exceptions": [ { "name": "TypeError", "message": "Callback returned incorrect type; expected 'Promise'", "timestamp": 1721583387361 } ], "logs": [], "eventTimestamp": 1721583387343, "event": { "request": { "url": "https://session-state.d1.compact.workers.dev/create", "method": "POST", "headers": { "content-type": "application/json" } } }, "id": 0 }