logto-io / js

🤓 Logto JS SDKs.
https://docs.logto.io/quick-starts/
MIT License
67 stars 40 forks source link

Can't resolve 'crypto' #517

Closed HighError closed 1 year ago

HighError commented 1 year ago

Describe the bug

Module not found: Can't resolve 'crypto' when I create /api/sign-in/route.ts and copy the code from the example. Expected 2 arguments, but got 1 for return logtoClient.handleSignIn()(request);

How to reproduce?

Follow the instructions https://docs.logto.io/docs/recipes/integrate-logto/next-js-13/

Context

Screenshots

image image

HighError commented 1 year ago

image image

wangsijie commented 1 year ago

What is the runtime of the Next.js server? If your runtime is edge-like, it may not support cyrpto, in this case, you can try the edge sdk

HighError commented 1 year ago

oh sorry, i import "@logto/next", not @logto/next/edge. I trusted the IDE