From 4796cb83afd0813cdc61e248bc9867e4c6ab1f7a Mon Sep 17 00:00:00 2001 From: "Wu, Zhenyu" Date: Mon, 18 Mar 2024 21:21:57 +0800 Subject: [PATCH] Fix: Check if object is extensible Refer https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Cant_define_property_object_not_extensible --- client/src/extension.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/extension.ts b/client/src/extension.ts index d06369a40..05a84833d 100644 --- a/client/src/extension.ts +++ b/client/src/extension.ts @@ -57,7 +57,7 @@ function updatePythonPath (): void { for (const pythonSubConf of ['autoComplete.extraPaths', 'analysis.extraPaths']) { const extraPaths = pythonConfig.get(pythonSubConf) ?? [] for (const pathToAdd of [pathToBitbakeLib, pathToPokyMetaLib]) { - if (!extraPaths.includes(pathToAdd)) { + if (!extraPaths.includes(pathToAdd) && Object.isExtensible(extraPaths)) { extraPaths.push(pathToAdd) } void pythonConfig.update(pythonSubConf, extraPaths, vscode.ConfigurationTarget.Workspace)