client docker file update for ignoring optional deps
This commit is contained in:
@@ -158,6 +158,31 @@ docker compose up -d --build
|
||||
Rebuild the client whenever a `NEXT_PUBLIC_*` value in `client/.env.production` changes — those are
|
||||
compiled into the browser bundle, so restarting the container alone changes nothing.
|
||||
|
||||
## Known wrinkle: the client lockfile is Windows-generated
|
||||
|
||||
`client/package-lock.json` is produced on Windows, where npm filters out wasm32-only optional packages
|
||||
and therefore never records their transitive dependencies (`@emnapi/core`, `@emnapi/runtime`). On Linux
|
||||
npm *does* want them, so a bare `npm ci` fails with:
|
||||
|
||||
```
|
||||
npm error `npm ci` can only install packages when your package.json and package-lock.json ... are in sync.
|
||||
npm error Missing: @emnapi/runtime@1.11.3 from lock file
|
||||
```
|
||||
|
||||
The client Dockerfile works around this by completing the lock inside the image before installing. To fix
|
||||
it permanently, regenerate the lock **on Linux** once and commit the result:
|
||||
|
||||
```bash
|
||||
cd client
|
||||
docker run --rm -v "$PWD:/app" -w /app node:24-alpine npm install --package-lock-only --no-audit --no-fund
|
||||
```
|
||||
|
||||
Then drop the `npm install --package-lock-only` line from `client/Dockerfile`, leaving just `npm ci`.
|
||||
|
||||
Note `--omit=optional` is **not** a valid shortcut here: Turbopack resolves `@parcel/watcher`'s native
|
||||
binary through `optionalDependencies`, so omitting them breaks `next build` with
|
||||
`No prebuild or local build of @parcel/watcher found`.
|
||||
|
||||
## Persisted state
|
||||
|
||||
Two named volumes survive rebuilds. Uploaded verification documents live in the first one; losing it
|
||||
|
||||
Reference in New Issue
Block a user