Skip to content

Commit 4b41495

Browse files
authored
fix(amazonq): isolate flare from user aws config files (#5906)
due to an AWS JS SDK v2 bug (which is EoL), profile redeclarion, though spec compliant, will result in a flare crash
1 parent b8b79ac commit 4b41495

File tree

1 file changed

+4
-0
lines changed
  • plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp

1 file changed

+4
-0
lines changed

plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/AmazonQLspService.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@ private class AmazonQServerInstance(private val project: Project, private val cs
463463

464464
val node = if (SystemInfo.isWindows) "node.exe" else "node"
465465
val nodePath = getNodeRuntimePath(artifact.resolve(node))
466+
val emptyFile = Files.createTempFile("empty", null).toAbsolutePath().toString()
466467

467468
val cmd = NodeExePatcher.patch(nodePath)
468469
.withParameters(
@@ -476,6 +477,9 @@ private class AmazonQServerInstance(private val project: Project, private val cs
476477
put("NODE_EXTRA_CA_CERTS", it)
477478
}
478479

480+
put("AWS_CONFIG_FILE", emptyFile)
481+
put("AWS_SHARED_CREDENTIALS_FILE", emptyFile)
482+
479483
// assume default endpoint will pick correct proxy if needed
480484
val qUri = URI(QDefaultServiceConfig.ENDPOINT)
481485
val proxy = JdkProxyProvider.getInstance().proxySelector.select(qUri)

0 commit comments

Comments
 (0)