fix(web): downgrade react-leaflet to v4 for React 18 compatibility

react-leaflet v5 requires React 19 — caused "render2 is not a function"
runtime crash and white screen. Downgraded to v4.2.1.

fix(docker): separate DB volume mount from API dist directory

Volume was mounted at /app/apps/api, overwriting compiled dist/ with stale
files from previous container runs. Changed mount to /app/data for DB only.

fix(api): copy area.json and vessel1.json into API Docker image

Seed files could not resolve JSON data at container startup.
Added COPY in Dockerfile and corrected path depth from 5 to 4 levels.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
vinihcrosaandClaude Sonnet 4.6 committed 2026-06-28 03:44:16 -03:00
1 parent 788f7982f9
commit 6ba2755448
6 files changed
+19 -18

No files matched your search

+1 -1
View File
@@ -7,7 +7,7 @@ import { areas } from './schema.js'
const __dirname = dirname(fileURLToPath(import.meta.url))
const AREA_JSON_PATH =
process.env.AREA_JSON_PATH ?? resolve(__dirname, '../../../../../area.json')
process.env.AREA_JSON_PATH ?? resolve(__dirname, '../../../../area.json')
interface AreaJson {
name: string
+1 -1
View File
@@ -16,7 +16,7 @@ const __dirname = dirname(fileURLToPath(import.meta.url))
// Default: vessel1.json at repo root, two directories above apps/api/
const VESSEL1_PATH =
process.env.VESSEL1_JSON_PATH ?? resolve(__dirname, '../../../../../vessel1.json')
process.env.VESSEL1_JSON_PATH ?? resolve(__dirname, '../../../../vessel1.json')
interface Vessel1Json {
name: string
+1 -1
View File
@@ -19,7 +19,7 @@
"leaflet": "^1.9.4",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-leaflet": "^5.0.0",
"react-leaflet": "4",
"zustand": "^5.0.0"
},
"devDependencies": {
+2 -2
View File
@@ -14,11 +14,11 @@ services:
ports:
- "3000:3000"
volumes:
- ymir_db:/app/apps/api
- ymir_db:/app/data
environment:
PORT: "3000"
HOST: "0.0.0.0"
DB_PATH: "/app/apps/api/ymir.db"
DB_PATH: "/app/data/ymir.db"
web:
build:
+1
View File
@@ -23,5 +23,6 @@ COPY apps/api/package.json ./apps/api/
RUN pnpm install --frozen-lockfile --prod
COPY --from=builder /app/packages/types/dist/ ./packages/types/dist/
COPY --from=builder /app/apps/api/dist/ ./apps/api/dist/
COPY area.json vessel1.json ./
EXPOSE 3000
CMD ["node", "apps/api/dist/index.js"]
+13 -13
View File
@@ -67,8 +67,8 @@ importers:
specifier: ^18.3.1
version: 18.3.1(react@18.3.1)
react-leaflet:
specifier: ^5.0.0
version: 5.0.0(leaflet@1.9.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
specifier: '4'
version: 4.2.1(leaflet@1.9.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
zustand:
specifier: ^5.0.0
version: 5.0.14(@types/react@18.3.31)(react@18.3.1)
@@ -915,12 +915,12 @@ packages:
engines: {node: '>=18'}
hasBin: true
'@react-leaflet/core@3.0.0':
resolution: {integrity: sha512-3EWmekh4Nz+pGcr+xjf0KNyYfC3U2JjnkWsh0zcqaexYqmmB5ZhH37kz41JXGmKzpaMZCnPofBBm64i+YrEvGQ==}
'@react-leaflet/core@2.1.0':
resolution: {integrity: sha512-Qk7Pfu8BSarKGqILj4x7bCSZ1pjuAPZ+qmRwH5S7mDS91VSbVVsJSrW4qA+GPrro8t69gFYVMWb1Zc4yFmPiVg==}
peerDependencies:
leaflet: ^1.9.0
react: ^19.0.0
react-dom: ^19.0.0
react: ^18.0.0
react-dom: ^18.0.0
'@rolldown/pluginutils@1.0.0-beta.27':
resolution: {integrity: sha512-+d0F4MKMCbeVUJwG96uQ4SgAznZNSq93I3V+9NHA4OpvqG8mRCpGdKmK8l/dl02h2CCDHwW2FqilnTyDcAnqjA==}
@@ -1825,12 +1825,12 @@ packages:
react-is@17.0.2:
resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==}
react-leaflet@5.0.0:
resolution: {integrity: sha512-CWbTpr5vcHw5bt9i4zSlPEVQdTVcML390TjeDG0cK59z1ylexpqC6M1PJFjV8jD7CF+ACBFsLIDs6DRMoLEofw==}
react-leaflet@4.2.1:
resolution: {integrity: sha512-p9chkvhcKrWn/H/1FFeVSqLdReGwn2qmiobOQGO3BifX+/vV/39qhY8dGqbdcPh1e6jxh/QHriLXr7a4eLFK4Q==}
peerDependencies:
leaflet: ^1.9.0
react: ^19.0.0
react-dom: ^19.0.0
react: ^18.0.0
react-dom: ^18.0.0
react-refresh@0.17.0:
resolution: {integrity: sha512-z6F7K9bV85EfseRCp2bzrpyQ0Gkw1uLoCel9XBVWPg/TjRj94SkJzUTGfOa4bs7iJvBWtQG0Wq7wnI0syw3EBQ==}
@@ -2698,7 +2698,7 @@ snapshots:
dependencies:
playwright: 1.61.1
'@react-leaflet/core@3.0.0(leaflet@1.9.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)':
'@react-leaflet/core@2.1.0(leaflet@1.9.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)':
dependencies:
leaflet: 1.9.4
react: 18.3.1
@@ -3576,9 +3576,9 @@ snapshots:
react-is@17.0.2: {}
react-leaflet@5.0.0(leaflet@1.9.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1):
react-leaflet@4.2.1(leaflet@1.9.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1):
dependencies:
'@react-leaflet/core': 3.0.0(leaflet@1.9.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
'@react-leaflet/core': 2.1.0(leaflet@1.9.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
leaflet: 1.9.4
react: 18.3.1
react-dom: 18.3.1(react@18.3.1)