ory / integrations

Apache License 2.0
19 stars 24 forks source link

Support Next.js experimental runtime edge #49

Open timReynolds opened 1 year ago

timReynolds commented 1 year ago

To deploy Next.js 13 to a provider like Cloudflare you need to use the new experimental edge runtime "edge" but this doesn't work with the integration provided here due to the use of request.

error - Error: The edge runtime does not support Node.js 'util' module.
Learn More: https://nextjs.org/docs/messages/node-module-in-edge-runtime
    at <unknown> (webpack-internal:///(middleware)/./node_modules/next/dist/esm/server/web/adapter.js:189)
    at Object.get (webpack-internal:///(middleware)/./node_modules/next/dist/esm/server/web/adapter.js:189:19)
    at eval (webpack-internal:///(middleware)/./node_modules/tough-cookie/lib/memstore.js:55:18)
    at Object.(middleware)/./node_modules/tough-cookie/lib/memstore.js (evalmachine.<anonymous>:2021:1)
    at __webpack_require__ (evalmachine.<anonymous>:37:33)
    at fn (evalmachine.<anonymous>:281:21)
    at eval (webpack-internal:///(middleware)/./node_modules/tough-cookie/lib/cookie.js:37:26)
    at Object.(middleware)/./node_modules/tough-cookie/lib/cookie.js (evalmachine.<anonymous>:2010:1)
    at __webpack_require__ (evalmachine.<anonymous>:37:33)
    at fn (evalmachine.<anonymous>:281:21)
    at eval (webpack-internal:///(middleware)/./node_modules/request/lib/cookies.js:3:13)
aeneasr commented 1 year ago

Thank you for the report! I'm not sure how we can address this at the moment :/