Skip to content

Commit d2368b6

Browse files
authored
chore: extra guards process.env (#5281)
evidently some places have `process` but not `process.env`
1 parent 5463f8f commit d2368b6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/@lwc/engine-core/src/framework/check-version-mismatch.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@ export function checkVersionMismatch(
3838
) {
3939
const versionMatcher = func.toString().match(LWC_VERSION_COMMENT_REGEX);
4040
if (!isNull(versionMatcher) && !warned) {
41-
if (typeof process === 'object' && process.env.SKIP_LWC_VERSION_MISMATCH_CHECK === 'true') {
41+
if (
42+
typeof process === 'object' &&
43+
typeof process?.env === 'object' &&
44+
process.env &&
45+
process.env.SKIP_LWC_VERSION_MISMATCH_CHECK === 'true'
46+
) {
4247
warned = true; // skip printing out version mismatch errors when env var is set
4348
return;
4449
}

0 commit comments

Comments
 (0)