Port popup to React; fix backend port colliding with Vite dev server

Popup is now a real React app (App.tsx/main.tsx via createRoot),
wired through @wxt-dev/module-react. tsconfig.json needed an explicit
jsx: "react-jsx" -- WXT's generated .wxt/tsconfig.json doesn't set
it, so tsc --noEmit failed on JSX syntax even though the Vite build
itself was fine.

Root cause of the actually-reported bug (blank popup, predating the
React port too): the backend defaulted to port 3000, the same port
WXT's dev server uses for this extension. With both running, the
popup's script tags pointed at the Vite dev server but the backend
answered instead, so main.tsx never loaded -- "View Page Source"
showed raw unbundled dev-mode HTML pointing at localhost:3000.
Backend now binds :8080 (see backend commit), and
BACKEND_HTTP_URL/BACKEND_WS_URL + host_permissions here follow it.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YXiHuScXrjxBh7yFGAPq3B
This commit is contained in:
2026-09-07 11:56:05 +02:00
co-authored by claude
parent 3302a78536
commit 58e32caa5c
10 changed files with 662 additions and 278 deletions
+4 -2
View File
@@ -3,15 +3,17 @@ import { defineConfig } from 'wxt';
// See https://wxt.dev/api/config.html
export default defineConfig({
srcDir: 'src',
modules: ['@wxt-dev/module-react'],
// Target Manifest V3 on both Chromium and Firefox (modern Firefox / Zen support it).
manifestVersion: 3,
manifest: {
name: 'Nexa',
description: 'Your blockchain powered agent to help with your trading emotions.',
permissions: ['storage'],
// axiom.trade: the site adapter target. localhost:3000: the Nexa backend
// axiom.trade: the site adapter target. localhost:8080: the Nexa backend
// (dev only — swap/extend for the real backend host before shipping).
host_permissions: ['https://axiom.trade/*', 'http://localhost:3000/*'],
// Not 3000 — that's this extension's own Vite dev server port.
host_permissions: ['https://axiom.trade/*', 'http://localhost:8080/*'],
browser_specific_settings: {
gecko: {
// Placeholder id for local/dev builds; replace before publishing to AMO.