Skip to content

Commit 2b2fe6a

Browse files
jonas-jonasory-bot
authored andcommitted
fix: adjust check for runtime detection to allow edge runtime
GitOrigin-RevId: 56ac5c1298294b5972ac05ccb1f44a5371a1cacd
1 parent 65f59bd commit 2b2fe6a

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

packages/elements-react/src/context/config.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ type OryElementsConfigContextType = {
8989
}
9090

9191
const OryConfigurationContext = createContext<OryElementsConfigContextType>({
92-
sdk: computeSdkConfig({}),
92+
sdk: null!, // This is fine, because we always supply a proper default value for the SDK configuration in the provider
9393
project: defaultProject,
9494
})
9595

@@ -156,11 +156,7 @@ function computeSdkConfig(config?: OryClientConfiguration["sdk"]): SDKConfig {
156156
}
157157

158158
function getSDKUrl() {
159-
if (
160-
typeof process !== "undefined" &&
161-
process.versions &&
162-
process.versions.node
163-
) {
159+
if (typeof process !== "undefined" && !!process.env) {
164160
// process is available, let's try some environment variables
165161
if (isProduction()) {
166162
const sdkUrl =

0 commit comments

Comments
 (0)