fix(reflex): fix app module path and npm registry | ApprovalToken: 1767140333
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
- Export app from src/__init__.py so Reflex can find it - Set app_name to 'src' in rxconfig.py to match module structure - Remove .npmrc before setting npm registry to avoid mirror override - Add registry verification in Dockerfile - Fixes ModuleNotFoundError and npm registry issues
This commit is contained in:
@@ -61,11 +61,16 @@ RUN reflex init --loglevel debug || true && \
|
||||
RUN if [ -d "/build/.web" ] && [ -f "/build/.web/package.json" ]; then \
|
||||
echo "Found .web directory with package.json, building frontend..." && \
|
||||
cd /build/.web && \
|
||||
# Remove any existing .npmrc that might override registry
|
||||
rm -f .npmrc && \
|
||||
# Set npm registry to official registry
|
||||
npm config set registry https://registry.npmjs.org/ && \
|
||||
npm config set fetch-retry-mintimeout 20000 && \
|
||||
npm config set fetch-retry-maxtimeout 120000 && \
|
||||
npm config set fetch-retries 5 && \
|
||||
npm config set fetch-timeout 300000 && \
|
||||
# Verify registry is set correctly
|
||||
echo "Using npm registry: $(npm config get registry)" && \
|
||||
if [ -f "package-lock.json" ]; then \
|
||||
npm ci --prefer-offline --no-audit --loglevel verbose || \
|
||||
(echo "npm ci failed, retrying with npm install..." && npm install --prefer-offline --no-audit --loglevel verbose); \
|
||||
|
||||
@@ -13,7 +13,7 @@ BACKEND_PORT = int(os.getenv("BACKEND_PORT", "8000"))
|
||||
DB_URL = os.getenv("DATABASE_URL", "sqlite:////app/data/reflex.db")
|
||||
|
||||
config = rx.Config(
|
||||
app_name="src.presentation.web.pages.landing.index",
|
||||
app_name="src",
|
||||
api_url=API_URL,
|
||||
frontend_port=FRONTEND_PORT,
|
||||
backend_port=BACKEND_PORT,
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
"""Peikarband Landing Application.
|
||||
|
||||
This module exports the Reflex app instance for the landing page.
|
||||
"""
|
||||
|
||||
# Import the app from the landing page module
|
||||
from src.presentation.web.pages.landing.index import app
|
||||
|
||||
__all__ = ["app"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user