From 48e937dc2b13ea80522c3de35bd958ee20c579cf Mon Sep 17 00:00:00 2001 From: Nikos Douvlis Date: Tue, 21 Feb 2023 00:45:47 +0200 Subject: [PATCH] fix(backend): Support the Vercel edge-light runtime key (#841) The edge-light runtime key was recently added as a condition name for the edge runtime in this PR: https://github.com/vercel/next.js/pull/45188 However, this PR also introduced a change (which might not be intentional): the `node` runtime key is now a valid condition key for the edge runtime, so it matches before our `default` import. This PR adds the `edge-light` key before `node` so that we guarantee that the correct imports will always be used. --- packages/backend/package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/backend/package.json b/packages/backend/package.json index 515b072ba3..e33f6d5d3e 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -55,10 +55,12 @@ }, "imports": { "#crypto": { + "edge-light": "./dist/runtime/browser/crypto.mjs", "node": "./dist/runtime/node/crypto.js", "default": "./dist/runtime/browser/crypto.mjs" }, "#fetch": { + "edge-light": "./dist/runtime/browser/fetch.mjs", "node": "./dist/runtime/node/fetch.js", "default": "./dist/runtime/browser/fetch.mjs" }