Commit e1f403f
authored
fix(amazonq): avoid ERR_UNSUPPORTED_ESM_URL_SCHEME error when loading indexer on Windows (#1135)
## Problem
The codewhisperer server fails to load the project context indexer on windows, raising a `ERR_UNSUPPORTED_ESM_URL_SCHEME ` failure. This happens when the library is imported with a regular path on Windows:
https://github.com/aws/language-servers/blob/e4d4ef026c8a60cc1ddf08c981340a902d628016/server/aws-lsp-codewhisperer/src/shared/localProjectContextController.ts#L142-L143
Some information from nodejs/node#31710 indicates that code running on Windows must use URLs so that local file paths (including drive letters) are not mistakenly interpreted as things like http urls.
## Solution
Wrap the path in a URL when running on Windows.1 parent e4d4ef0 commit e1f403f
File tree
1 file changed
+15
-1
lines changed1 file changed
+15
-1
lines changedLines changed: 15 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
142 | | - | |
| 143 | + | |
143 | 144 | | |
144 | 145 | | |
145 | 146 | | |
| |||
153 | 154 | | |
154 | 155 | | |
155 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
156 | 170 | | |
157 | 171 | | |
158 | 172 | | |
| |||
0 commit comments