Octo8080X / fresh-session

Dead simple cookie-based session for Deno Fresh.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error on deno deploy

KorigamiK opened this issue · comments

Whenever I try to load a page which requires the session this error appears.

An error occurred during route handling or page rendering. ReferenceError: Worker is not defined
    at hash (https://deno.land/x/bcrypt@v0.4.0/src/main.ts:11:18)
    at Register (file:///src/src/database/controller.ts:19:25)
    at GET (file:///src/routes/signup.tsx:12:26)
    at routes.<computed> (https://deno.land/x/fresh@1.0.2/src/server/context.ts:319:81)
    at https://crux.land/api/get/uYQG.ts:83:42
    at https://deno.land/x/fresh@1.0.2/src/server/context.ts:208:31
    at Object.next (https://deno.land/x/fresh@1.0.2/src/server/context.ts:200:44)
    at cookieSession (https://deno.land/x/fresh_session@0.1.7/src/stores/cookie.ts:65:32)
    at async Server.#respond (https://deno.land/std@0.150.0/http/server.ts:219:24)

What is the cause and the required fix?

Turns out, it was the hashing and comparing functions from bcrypt which are not supported in deploy yet.

Relevant issue was:

JamesBroadberry/deno-bcrypt#26

Re-opening so I can check this out and find an alternative, this seems critical enough for me to find an alternative library / method.

Thanks for reporting

I tried to reproduce the issue on a new project + on a project I'm working on which are both deployed on Deno Deploy but couldn't have the same error.

Can you provide some code which trigger the issue ?

without any reproduction step, hard for me to tackle this.

closing for now.