From dd02ff5677fdd9704da4bacdaf2850882e9f6743 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 15 Mar 2026 21:06:07 +0000 Subject: [PATCH] fix(mobile): suppress Node.js url.parse() deprecation and document Apple session fix - Add NODE_NO_WARNINGS=1 to all eas.json build profiles (development, preview, production) to suppress [DEP0169] url.parse() deprecation warnings emitted by EAS CLI when the build image's system Node is 22+ - Add NODE_NO_WARNINGS=1 env to both EAS Cloud Workflow jobs (.eas/workflows/create-builds.yml) with explanatory comments - Fix outdated Node.js prerequisite in docs/MobileApp.md (was "18 or later", now "20.19.4 or later" with nvm guidance) - Add troubleshooting sections in docs/MobileApp.md and mobile/README.md covering both the "Session expired Local session" error (Apple ID session expiry + App Store Connect API key recommendation) and the [DEP0169] Node.js deprecation warning Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com> --- docs/MobileApp.md | 39 ++++++++++++++++++++++- mobile/.eas/workflows/create-builds.yml | 8 +++++ mobile/README.md | 41 +++++++++++++++++++++++++ mobile/eas.json | 9 ++++++ 4 files changed, 96 insertions(+), 1 deletion(-) diff --git a/docs/MobileApp.md b/docs/MobileApp.md index 3ee12e01..2d697c98 100644 --- a/docs/MobileApp.md +++ b/docs/MobileApp.md @@ -20,7 +20,7 @@ DocuElevate includes a native mobile application for iOS and Android built with ### Prerequisites -- Node.js 18 or later +- Node.js 20.19.4 or later (use [nvm](https://github.com/nvm-sh/nvm): `nvm install` inside `mobile/` reads `.nvmrc` automatically) - [Expo CLI](https://docs.expo.dev/get-started/installation/): `npm install -g @expo/cli` - [Expo Go](https://expo.dev/client) app on your iOS or Android device (for development) - A running DocuElevate server reachable from your device @@ -242,6 +242,43 @@ mobile/ ## Troubleshooting +### "Session expired Local session" during iOS build + +EAS stores an Apple ID session locally (in `~/.expo/`) to manage code-signing certificates and provisioning profiles. This session expires after a few weeks. + +**To fix:** + +1. **Refresh the session** by running `eas credentials` and re-authenticating with your Apple ID. +2. **Recommended for automation:** Replace the Apple ID session with an [App Store Connect API Key](https://docs.expo.dev/app-signing/app-credentials/#app-store-connect-api-key). API keys do not expire and work fully non-interactively: + - Create a key at [appstoreconnect.apple.com → Users → Integrations → Keys](https://appstoreconnect.apple.com/access/integrations/api) + - Download the `.p8` file and note the **Key ID** and **Issuer ID** + - Run `eas credentials` → iOS → *Add an App Store Connect API key* + - Upload the `.p8` file when prompted + +Once an API key is configured in EAS, automated builds (including CI and EAS Cloud Workflows) will no longer prompt for a password. + +### Node.js deprecation warning `[DEP0169]` during EAS build + +``` +(node:XXXXX) [DEP0169] DeprecationWarning: `url.parse()` behavior is not standardized… +``` + +This warning is emitted by **EAS CLI** (an external tool) when it runs on **Node.js 22 or later**, which deprecates `url.parse()`. It does not indicate a problem in the DocuElevate mobile app itself and will not cause a build failure on its own. + +The `eas.json` build profiles already include `"NODE_NO_WARNINGS": "1"` in their `env` sections to suppress this warning during EAS Cloud builds. For local builds with a system Node.js ≥ 22, suppress it by running: + +```bash +NODE_NO_WARNINGS=1 eas build --platform ios +``` + +or by activating the project's pinned Node.js version first: + +```bash +cd mobile +nvm use # reads .nvmrc → Node 20.19.4 (no deprecation warning) +eas build --platform ios +``` + ### "Authentication was cancelled or failed" - Ensure the server URL is correct (including `https://`). diff --git a/mobile/.eas/workflows/create-builds.yml b/mobile/.eas/workflows/create-builds.yml index ba587e6e..e3cbdff6 100644 --- a/mobile/.eas/workflows/create-builds.yml +++ b/mobile/.eas/workflows/create-builds.yml @@ -9,6 +9,10 @@ jobs: build_android: name: Build Android app type: build + env: + # Suppress Node.js url.parse() deprecation warnings ([DEP0169]) emitted by + # EAS CLI when running on the build image's system Node 22+. + NODE_NO_WARNINGS: "1" params: platform: android profile: production @@ -16,6 +20,10 @@ jobs: build_ios: name: Build iOS app type: build + env: + # Suppress Node.js url.parse() deprecation warnings ([DEP0169]) emitted by + # EAS CLI when running on the build image's system Node 22+. + NODE_NO_WARNINGS: "1" params: platform: ios profile: production diff --git a/mobile/README.md b/mobile/README.md index 30acf511..03ec4b3d 100644 --- a/mobile/README.md +++ b/mobile/README.md @@ -158,3 +158,44 @@ The mobile app uses the following backend endpoints: | `GET` | `/api/files` | List processed documents | Authentication uses `Authorization: Bearer ` on all requests. + +## Troubleshooting + +### `Session expired Local session` when running `eas build` + +EAS CLI stores an Apple ID session locally to manage provisioning profiles and code-signing certificates. This session expires after several weeks. + +**Quick fix (local):** Re-authenticate by running: + +```bash +eas credentials +``` + +Select iOS → re-enter your Apple ID credentials when prompted. + +**Recommended (CI / automation):** Switch to an [App Store Connect API Key](https://docs.expo.dev/app-signing/app-credentials/#app-store-connect-api-key) which does not expire automatically and works non-interactively: + +1. Go to [appstoreconnect.apple.com → Users → Integrations → Keys](https://appstoreconnect.apple.com/access/integrations/api) and create a key with *Developer* or *App Manager* role. +2. Download the `.p8` file; note the **Key ID** and **Issuer ID**. +3. Run `eas credentials` → iOS → *Add an App Store Connect API key* and upload the `.p8` file. + +Once an API key is stored in EAS, all future builds (local and CI) will use it automatically without requiring an Apple ID session. + +### `[DEP0169] DeprecationWarning: url.parse()` during build + +```text +(node:XXXXX) [DEP0169] DeprecationWarning: `url.parse()` behavior is not standardized… +``` + +This is emitted by EAS CLI itself when it runs on **Node.js 22 or later**, which deprecates `url.parse()`. It is a warning only and does not cause build failures on its own. The `eas.json` build profiles already suppress it via `"NODE_NO_WARNINGS": "1"` in their `env` sections. + +To suppress the warning locally, either: + +```bash +# Option A: Run with the warning suppressed +NODE_NO_WARNINGS=1 eas build --platform ios + +# Option B: Switch to the pinned Node version (no warning on Node 20) +nvm use # reads .nvmrc → Node 20.19.4 +eas build --platform ios +``` diff --git a/mobile/eas.json b/mobile/eas.json index 36aeabf6..8633ced0 100644 --- a/mobile/eas.json +++ b/mobile/eas.json @@ -8,6 +8,9 @@ "developmentClient": true, "distribution": "internal", "node": "20.19.4", + "env": { + "NODE_NO_WARNINGS": "1" + }, "ios": { "image": "macos-sequoia-15.5-xcode-26.0" } @@ -15,6 +18,9 @@ "preview": { "distribution": "internal", "node": "20.19.4", + "env": { + "NODE_NO_WARNINGS": "1" + }, "ios": { "simulator": false, "image": "macos-sequoia-15.5-xcode-26.0" @@ -23,6 +29,9 @@ "production": { "autoIncrement": true, "node": "20.19.4", + "env": { + "NODE_NO_WARNINGS": "1" + }, "ios": { "image": "macos-sequoia-15.5-xcode-26.0" }