Open emctague opened 1 year ago
It seems explicitly requiring src/auth.ts
serves as a workaround...
import { verifyJwt } from "@atproto/xrpc-server/src/auth";
But being unable to use the package from a Next project in a normal way is still.. unfortunate.
hmm these seem to come from the ws
package: https://www.npmjs.com/package/ws (see the "Opt-in for performance" section)
I'm a bit surprised that it's failing though, I've used this package in other node projects with no problem. Maybe it's a NextJS constraint? Seems like you should run into this if node buffers are available
Describe the bug
When trying to use verifyJwt() on the server-side, I get the warnings:
To Reproduce
Steps to reproduce the behavior:
await xrpc.verifyJwt(jwt, did, async () => BSKY_PUBLIC_KEY)
whereconst BSKY_PUBLIC_KEY = "zQYEBzXeuTM9UR3rfvNag6L3RNAs5pQZyYPsomTsgQhsxLdEgCrPTLgFna8yqCnxPpNT7DBk6Ym3dgPKNu86vt9GR"
.utf-8-validate
andbufferutil
. Install them.Expected behavior
All dependencies for the package should be installed when the package is installed, and the package should not produce strange at runtime instead of properly verifying the JWT.
Details
Additional context
This same project also uses
@atproto/api
, which works fine and never raised any dependency errors in this manner.