panva / openid-client

High-Level OAuth 2 / OpenID Connect Client API for JavaScript Runtimes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

client won't run under `edge` runtime

muradm opened this issue · comments

commented

Describe the bug
oidc-token-hash is not compatible with edge runtime:

- error node_modules/oidc-token-hash/lib/shake256.js (3:0) @ <unknown>
- error Cannot read properties of undefined (reading 'substring'

To Reproduce

npx create-next-app@latest ...
npm i -S openid-client
import { Issuer } from 'openid-client'

await Issuer.discover('...')
npm run dev

Error happens at import time, does not even proceed to service handling time.

Expected behaviour
Should normally work as documented under edge environment.

Environment:

  • openid-client version: v5.4.2
  • next version: v13.4.5
  • node version: v18.16.0

It is not intended for any other runtime than node. https://github.com/panva/oauth4webapi on the other hand is for such runtimes.