Skip to content

Commit 3efd32a

Browse files
fix: prod test run
1 parent 53bc835 commit 3efd32a

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

packages/@lwc/ssr-runtime/src/context.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ class ContextBinding<C extends LightningElement> implements IContextBinding<Ligh
3030
): void {
3131
const contextVarieties = this.component[SYMBOL__CONTEXT_VARIETIES];
3232
if (contextVarieties.has(contextVariety)) {
33-
throw new Error('Multiple contexts of the same variety were provided.');
33+
if (process.env.NODE_ENV !== 'production') {
34+
throw new Error('Multiple contexts of the same variety were provided.');
35+
}
36+
return;
3437
}
3538
contextVarieties.set(contextVariety, providedContextSignal);
3639
}
@@ -74,10 +77,12 @@ export function connectContext(le: LightningElement) {
7477
(le as any)[contextfulKeys[i]][connectContext](new ContextBinding(le));
7578
}
7679
} catch (err: any) {
77-
throw new Error(
78-
`Attempted to connect to trusted context but received the following error: ${
79-
err.message
80-
}`
81-
);
80+
if (process.env.NODE_ENV !== 'production') {
81+
throw new Error(
82+
`Attempted to connect to trusted context but received the following error: ${
83+
err.message
84+
}`
85+
);
86+
}
8287
}
8388
}

0 commit comments

Comments
 (0)