From 039f80cb5011e77e662738fc2a676cb89e833667 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Fri, 27 Dec 2024 17:23:54 -0300 Subject: [PATCH] refactor: Enhance frontend build process with detailed logging and error handling (#5473) --- Makefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 64fc6533a..a7c9612a0 100644 --- a/Makefile +++ b/Makefile @@ -72,10 +72,17 @@ install_frontend: ## install the frontend dependencies @cd src/frontend && npm install > /dev/null 2>&1 build_frontend: ## build the frontend static files - @echo 'Building frontend static files' - @cd src/frontend && CI='' npm run build + @echo '==== Starting frontend build ====' + @echo 'Current directory: $$(pwd)' + @echo 'Checking if src/frontend exists...' + @ls -la src/frontend || true + @echo 'Building frontend static files...' + @cd src/frontend && CI='' npm run build 2>&1 || { echo "\nBuild failed! Error output above ☝️"; exit 1; } + @echo 'Clearing destination directory...' $(call CLEAR_DIRS,src/backend/base/langflow/frontend) + @echo 'Copying build files...' @cp -r src/frontend/build/. src/backend/base/langflow/frontend + @echo '==== Frontend build complete ====' init: check_tools clean_python_cache clean_npm_cache ## initialize the project @make install_backend