We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 243728b commit b891ff7Copy full SHA for b891ff7
packages/@lwc/ssr-client-utils/src/index.ts
@@ -62,6 +62,12 @@ export function registerLwcStyleComponent() {
62
}
63
64
// Only used in LWC's Karma tests
65
-if (typeof process !== 'undefined' && process.env.NODE_ENV === 'test-karma-lwc') {
+// See PR-5281 for precedence on extra guards
66
+if (
67
+ typeof process === 'object' &&
68
+ typeof process?.env === 'object' &&
69
+ process.env &&
70
+ process.env.NODE_ENV === 'test-karma-lwc'
71
+) {
72
(window as any).__lwcClearStylesheetCache = () => stylesheetCache.clear();
73
0 commit comments