diff --git a/docker-entrypoint-simple.sh b/docker-entrypoint-simple.sh index debcbdf..768c761 100644 --- a/docker-entrypoint-simple.sh +++ b/docker-entrypoint-simple.sh @@ -51,6 +51,16 @@ fi echo "✅ Base de données configurée" +# Corriger le problème import.meta.dirname pour Node.js 18 +echo "🔧 Application du patch Node.js 18..." +if [ -f "/app/dist/index.js" ]; then + # Remplacer import.meta.dirname par "/app" (chemin fixe en production) + sed -i 's/import\.meta\.dirname/\"\/app\"/g' /app/dist/index.js + echo "✅ Patch appliqué avec succès" +else + echo "⚠️ Fichier dist/index.js non trouvé" +fi + # Démarrer l'application echo "🎯 Démarrage de RegisFlow..." export NODE_ENV=production diff --git a/replit.md b/replit.md index 1a13ead..3448fc6 100644 --- a/replit.md +++ b/replit.md @@ -317,8 +317,9 @@ Preferred communication style: Simple, everyday language. - ✅ Fixed missing prod-start.js references in Dockerfile and entrypoint scripts - ✅ Simplified Docker build process to use dist/index.js directly - ✅ Eliminated temporary compatibility scripts after project cleanup -- ✅ Streamlined production deployment with standard Node.js execution -- ✅ Production-ready Docker configuration without custom polyfills +- ✅ Fixed Node.js 18 import.meta.dirname undefined error with automatic patching +- ✅ Added sed-based patch in docker-entrypoint-simple.sh for production compatibility +- ✅ Production-ready Docker configuration with Node.js 18 compatibility ### Docker Production Deployment Fix (January 9, 2025) - ✅ Fixed "relation 'users' does not exist" error by adding drizzle-kit to production dependencies