wxt icon indicating copy to clipboard operation
wxt copied to clipboard

Error ECONNREFUSED is thrown on Windows for chrome on a clean project

Open kfwebdev opened this issue 4 months ago • 2 comments

Describe the bug

When I run pnpm dev I get the error after ~30sec. pnpm dev -b firefox, works and loads firefox. -b chrome or no -b fails as shown below.

Identical issue to #766 except for windows 10 and chrome.

> [email protected] dev
> wxt


WXT 0.20.7                                                                                                  1:29:44 PM
√ Started dev server @ http://localhost:3000                                                                1:29:44 PM
i Pre-rendering chrome-mv3 for development with Vite 6.3.5                                                  1:29:44 PM
√ Built extension in 679 ms                                                                                 1:29:45 PM
  ├─ .output\chrome-mv3-dev\manifest.json               1.05 kB
  ├─ .output\chrome-mv3-dev\popup.html                  777 B
  ├─ .output\chrome-mv3-dev\background.js               20.06 kB
  ├─ .output\chrome-mv3-dev\chunks\popup-f02QKjXp.js    8.07 kB
  ├─ .output\chrome-mv3-dev\content-scripts\content.js  25.17 kB
  ├─ .output\chrome-mv3-dev\icon\128.png                3.07 kB
  ├─ .output\chrome-mv3-dev\icon\16.png                 559 B
  ├─ .output\chrome-mv3-dev\icon\32.png                 916 B
  ├─ .output\chrome-mv3-dev\icon\48.png                 1.33 kB
  ├─ .output\chrome-mv3-dev\icon\96.png                 2.37 kB
  └─ .output\chrome-mv3-dev\wxt.svg                     1.07 kB
Σ Total size: 64.45 kB
× Command failed after 28.8 s                                                                               1:30:13 PM

 ERROR  connect ECONNREFUSED 127.0.0.1:52967                                                                1:30:13 PM

    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1636:16)

Reproduction

test.zip

Steps to reproduce

pnpm dlx wxt@latest init test --template react cd test pnpm i pnpm run dev

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (16) x64 Intel(R) Core(TM) i7-10875H CPU @ 2.30GHz
    Memory: 19.11 GB / 31.84 GB
  Binaries:
    Node: 22.15.0 - C:\web\nodejs\node.EXE
    npm: 10.9.2 - C:\web\nodejs\npm.CMD
    pnpm: 10.12.4 - C:\web\nodejs\pnpm.CMD
  Browsers:
    Chrome: 139.0.7258.67 (Official Build) (64-bit)
    Internet Explorer: 11.0.19041.5794
  npmPackages:
    "wxt": "^0.20.6"
    "web-ext": "8.9.0"

Used Package Manager

pnpm

Validations

kfwebdev avatar Aug 08 '25 05:08 kfwebdev

I know this is pretty old, but I ad this issue because my macbook was connected to my hotspot and mac does some weird sutff when doing this with networking (if someone knows more about this and would like to share please do! the hotspot thing is a confusing hole to me).

Here is my config that fixed the issue.

import { defineConfig } from "wxt";
import tailwindcss from "@tailwindcss/vite";

export default defineConfig({
  modules: ["@wxt-dev/module-react"],
  manifest: {
    permissions: ["storage", "tabs", "activeTab"],
  },

  vite: () => ({
    server: {
      host: "127.0.0.1",
      origin: "http://127.0.0.1:3000",
    },
    plugins: [tailwindcss()],
    host: "0.0.0.0",
    resolve: {
      alias: {
        "@": "./",
      },
    },
  }),
  dev: {
    server: { host: "127.0.0.1" },
  },
});

plutotom avatar Sep 19 '25 23:09 plutotom

I know this is pretty old, but I ad this issue because my macbook was connected to my hotspot and mac does some weird sutff when doing this with networking (if someone knows more about this and would like to share please do! the hotspot thing is a confusing hole to me).

Here is my config that fixed the issue.

import { defineConfig } from "wxt";
import tailwindcss from "@tailwindcss/vite";

export default defineConfig({
  modules: ["@wxt-dev/module-react"],
  manifest: {
    permissions: ["storage", "tabs", "activeTab"],
  },

  vite: () => ({
    server: {
      host: "127.0.0.1",
      origin: "http://127.0.0.1:3000",
    },
    plugins: [tailwindcss()],
    host: "0.0.0.0",
    resolve: {
      alias: {
        "@": "./",
      },
    },
  }),
  dev: {
    server: { host: "127.0.0.1" },
  },
});

Hey @plutotom thanks for sharing your solution! I will give it a try when I'm working on this project.

kfwebdev avatar Nov 09 '25 08:11 kfwebdev