Skip to content

[Bug Report]: HMR client prevents setting window.location (Firefox) #2266

@cobbweb

Description

@cobbweb

Steps to reproduce

  1. npm create farm@latest
  2. npm run dev
  3. In Firefox Dev Tools run: window.location.assign("https://github.com")
  4. Firefox attempts to load https://github.com/ but then goes back to http://localhost:9000

Reproduce link

No response

What is actually happening?

  1. Firefox initiates navigation to next page
  2. Causes WebSocket connection to close
  3. "close" handler executes window.location.reload()
  4. Firefox reloads http://localhost:9000 which overrides the previous navigation from step 1.

System Info

System:
    OS: Linux 6.12 cpe:/o:nixos:nixos:25.05 25.05 (Warbler)
    CPU: (12) x64 AMD Ryzen 5 7640U w/ Radeon 760M Graphics
    Memory: 43.47 GB / 60.64 GB
    Container: Yes
    Shell: 5.9 - /run/current-system/sw/bin/zsh
  Binaries:
    Node: 22.19.0 - /home/cobbweb/.nix-profile/bin/node
    Yarn: 4.9.4 - /nix/store/qxk3ayxjz80xqlh6f6qdpnnf73dvvkqx-yarn-berry-4.9.4/bin/yarn
    npm: 10.9.3 - /home/cobbweb/.nix-profile/bin/npm
    bun: 1.3.2 - /nix/store/v9gvgkbqpljpg1aq2ihb15656vs7v9pd-bun-1.3.2/bin/bun
  Browsers:
    Chromium: 141.0.7390.107
    Firefox: 144.0
    Firefox Developer Edition: 144.0
  npmPackages:
    @farmfe/core: ^1.6.7 => 1.7.11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions