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>
This commit is contained in:
copilot-swe-agent[bot]
2026-03-15 21:06:07 +00:00
parent db115a3c5d
commit dd02ff5677
4 changed files with 96 additions and 1 deletions
+38 -1
View File
@@ -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://`).
+8
View File
@@ -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
+41
View File
@@ -158,3 +158,44 @@ The mobile app uses the following backend endpoints:
| `GET` | `/api/files` | List processed documents |
Authentication uses `Authorization: Bearer <api_token>` 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
```
+9
View File
@@ -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"
}