diff --git a/reflex/utils/js_runtimes.py b/reflex/utils/js_runtimes.py index 9d1cc9de557..051cbdc3ddb 100644 --- a/reflex/utils/js_runtimes.py +++ b/reflex/utils/js_runtimes.py @@ -463,17 +463,16 @@ def _run_initial_install(primary_package_manager: str, env: dict) -> None: bun reports ``error: lockfile had changes, but lockfile is frozen`` when the persisted lockfile cannot satisfy the recovered package.json. When - that happens, point the user at ``reflex.lock/package.json`` so they can - delete it and let Reflex regenerate the dep set from scratch on the - next run. + that happens, point the user at ``reflex.lock`` so they can delete it and + let Reflex regenerate the dep set from scratch on the next run. Args: primary_package_manager: Path to the package manager executable. env: Extra environment variables for the subprocess. Raises: - SystemExit: If the install fails. The exit message tells the user - how to recover from a frozen-lockfile mismatch when applicable. + SystemExit: If the install fails. The exit message tells the user how + to recover from a frozen-lockfile mismatch when applicable. """ install_args = [ primary_package_manager, @@ -499,7 +498,9 @@ def _run_initial_install(primary_package_manager: str, env: dict) -> None: if process.returncode == 0: return - if any("lockfile had changes, but lockfile is frozen" in line for line in logs): + if any( + "lockfile had changes, but lockfile is frozen" in line for line in logs + ): root_dir = Path.cwd() / constants.Bun.ROOT_LOCKFILE_DIR console.error( "The persisted lockfile is out of sync with the recovered " diff --git a/tests/units/test_prerequisites.py b/tests/units/test_prerequisites.py index 0079366ce97..9a778ba12db 100644 --- a/tests/units/test_prerequisites.py +++ b/tests/units/test_prerequisites.py @@ -1096,8 +1096,10 @@ def run_package_manager(args, **kwargs): @pytest.mark.usefixtures("install_packages_env") -def test_run_initial_install_frozen_lockfile_error_helpful_message(monkeypatch, capsys): - """A frozen-lockfile mismatch surfaces a 'delete reflex.lock/package.json' hint.""" +def test_run_initial_install_frozen_lockfile_error_helpful_message( + monkeypatch, capsys +): + """A frozen-lockfile mismatch tells the user how to regenerate from scratch.""" class _FakeProcess: returncode = 1