def compile_or_validate_app(
    compile: bool = False, check_if_schema_up_to_date: bool = False
) -> bool:
    """Compile or validate the app module based on the default config.

    Args:
        compile: Whether to compile the app.
        check_if_schema_up_to_date: If True, check if the schema is up to date.

    Returns:
        If the app is compiled successfully.
    """
    try:
        if compile:
            compile_app(check_if_schema_up_to_date=check_if_schema_up_to_date)
        else:
            validate_app(check_if_schema_up_to_date=check_if_schema_up_to_date)
    except Exception as e:
        if isinstance(e, click.exceptions.Exit):
            return False

        import traceback

        sys_exception = sys.exception()

        try:
            colorize = _can_colorize()
            traceback.print_exception(e, colorize=colorize)  # pyright: ignore[reportCallIssue]
        except Exception:
            traceback.print_exception(sys_exception)
        return False
    return True
Compile or validate the app module based on the default config.

    Args:
        compile: Whether to compile the app.
        check_if_schema_up_to_date: If True, check if the schema is up to date.

    Returns:
        If the app is compiled successfully.
    
reflex/utils/prerequisites.py