az2aws 1.4.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.5.0](https://github.com/kuma0128/az2aws/compare/v1.4.0...v1.5.0) (2026-02-12)
4
+
5
+
6
+ ### Features
7
+
8
+ * optimize Docker image build ([#105](https://github.com/kuma0128/az2aws/issues/105)) ([fc7f491](https://github.com/kuma0128/az2aws/commit/fc7f491a3d3029f3dbca750b984cbb3b5ea4bd3a))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * handle TargetCloseError from incompatible browser profile ([#117](https://github.com/kuma0128/az2aws/issues/117)) ([d5c1752](https://github.com/kuma0128/az2aws/commit/d5c17521cd179891a13c8285d451ad353b47bc71))
14
+
3
15
  ## [1.4.0](https://github.com/kuma0128/az2aws/compare/v1.3.0...v1.4.0) (2026-02-12)
4
16
 
5
17
 
package/README.md CHANGED
@@ -186,6 +186,16 @@ You'll be prompted for username, password, and MFA if required. After login, use
186
186
 
187
187
  #### Troubleshooting
188
188
 
189
+ If you see `TargetCloseError: Protocol error (Target.setAutoAttach): Target closed`,
190
+ the browser profile may be incompatible with the bundled Chromium version
191
+ (e.g., after upgrading or downgrading az2aws). When using the default
192
+ managed profile (`~/.aws/chromium`) with "Stay logged in" enabled, az2aws
193
+ will automatically reset the profile and retry. If you have set
194
+ `BROWSER_USER_DATA_DIR` to point to an existing Chrome profile, az2aws
195
+ will **not** modify that directory — you will need to resolve the
196
+ incompatibility manually (e.g., update az2aws, or use a different
197
+ `BROWSER_USER_DATA_DIR`).
198
+
189
199
  If you see device compliance errors (e.g., "Device UnSecured Or Non-Compliant"),
190
200
  Try:
191
201
  `--mode gui` and use your system Chrome via `BROWSER_CHROME_BIN`.
package/lib/login.js CHANGED
@@ -235,13 +235,13 @@ exports.login = {
235
235
  }
236
236
  catch (e) {
237
237
  if (e instanceof Error &&
238
- e.constructor.name === "TargetCloseError" &&
239
- rememberMe) {
240
- const userDataDir = paths_1.paths.userDataDir || paths_1.paths.chromium;
241
- debug(`Browser launch failed with TargetCloseError. Resetting profile at ${userDataDir}`);
238
+ e.name === "TargetCloseError" &&
239
+ rememberMe &&
240
+ !paths_1.paths.userDataDir) {
241
+ debug(`Browser launch failed with TargetCloseError. Resetting profile at ${paths_1.paths.chromium}`);
242
242
  console.warn("Browser profile appears incompatible. Resetting profile data and retrying...");
243
- await promises_1.default.rm(userDataDir, { recursive: true, force: true });
244
- await (0, mkdirp_1.default)(userDataDir);
243
+ await promises_1.default.rm(paths_1.paths.chromium, { recursive: true, force: true });
244
+ await (0, mkdirp_1.default)(paths_1.paths.chromium);
245
245
  browser = await puppeteer_1.default.launch(launchParams);
246
246
  }
247
247
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "az2aws",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "Use Azure AD SSO to log into the AWS CLI. A modern, actively maintained alternative to aws-azure-login.",
5
5
  "main": "index.js",
6
6
  "author": {