HOW TO FIX THIS ERROR??
Unanswered
Auth posted this in #help-forum
AuthOP
Compiling /middleware ...
✓ Compiled /middleware in 801ms (153 modules)
Checking token for: /workspace
Found token: true
Invalid token: [Error: The edge runtime does not support Node.js 'crypto' module.
Learn More: https://nextjs.org/docs/messages/node-module-in-edge-runtime]25 Replies
Remove any lines importing or using the package crypto, or packages using crypto
Thats a solution to fix this error
you might need to use alt packages instead of crypto
@Auth is your issue resolved
@Auth https://pastebin.com/W4QYGwqk
jsonwebtoken doesnt work in the edge runtime. use alternatives such as jose
@joulev jsonwebtoken doesnt work in the edge runtime. use alternatives such as jose
AuthOP
THEY DONT GOT GOOD DOCS😭
@Anay-208 <@1045909242101633126> is your issue resolved
AuthOP
Yep, I just removed jwt verification
Tryna find a alternative
i understand jwt_secret
BUT WHAT IS SECRET
and WHY ENCODING IT
AND WHY IT SUPPORT UNIT8ARRAY
Red-necked Grebe
i use root layout to put some validation to replace middleware, because last time i check middleware or edge runtime does not support node redis XD
@Auth BUT WHAT IS SECRET
the thing used to encrypt the jwt
literally jwt_secret
literally jwt_secret
@Auth AND WHY IT SUPPORT UNIT8ARRAY
calm down
@Auth and WHY ENCODING IT
you encode it for it to be sent to the browser
@!=tgt the thing used to encrypt the jwt
literally jwt_secret
AuthOP
Secret = jwt secret && jwt = encoded token right?
@Auth Click to see attachment
AuthOP
And what's this???