Skip to content

Commit 53bc835

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

File tree

6 files changed

+24
-13
lines changed

6 files changed

+24
-13
lines changed
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
Attempted to connect to trusted context but received the following error: Multiple contexts of the same variety were provided.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<fixture-test>
2+
<template shadowrootmode="open">
3+
<div>
4+
context one value: context one
5+
</div>
6+
<div>
7+
context two value: context two
8+
</div>
9+
</template>
10+
</fixture-test>
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
Attempted to connect to trusted context but received the following error: le[contextfulKeys[i]][connectContext2] is not a function
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<fixture-test>
2+
<template shadowrootmode="open">
3+
<div>
4+
context value:
5+
</div>
6+
</template>
7+
</fixture-test>

packages/@lwc/ssr-runtime/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"devDependencies": {
5151
"@lwc/shared": "8.20.0",
5252
"@lwc/engine-core": "8.20.0",
53+
"@lwc/features": "8.20.0",
5354
"observable-membrane": "2.0.0"
5455
}
5556
}

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

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

0 commit comments

Comments
 (0)