Skip to content

PhysX WASM fails to load on Windows - CDN missing /web/ directory with PhysX files #827

@terminaldestiny

Description

@terminaldestiny

Environment

  • OS: Windows 10 (x64)
  • Bun: 1.3.2
  • Browser: Chrome 144, also tested Edge 144
  • Docker Desktop: Running

Problem

Game client stuck at 3% loading. Server starts fine and shows "Hyperscape Server Ready" on port 5555. Browser console shows:

  1. [physx-script-loader] Failed to load PhysX script (physx-script-loader.ts:70)
  2. PhysX WASM loading timeout after 30 seconds (PhysXManager.ts:316)

The game world loads correctly server-side (fishing spots initialize, 235 items loaded, 200 skill unlocks, 9 prayers, etc). The issue is client-side only.

Root Cause

The physx-script-loader.ts loads PhysX from the CDN at: ${cdnUrl}/web/physx-js-webidl.js?v=1.0.0

which resolves to http://localhost:8080/web/physx-js-webidl.js.

However, after running bun run cdn:up and bun run dev, the CDN container (hyperscape-cdn) does not have a /web/ directory. Running docker exec hyperscape-cdn ls /usr/share/nginx/html/ shows only:

  • 50x.html
  • assets
  • index.html

No /web/ folder exists. The PhysX files are built correctly in packages/physx-js-webidl/dist/ (physx-js-webidl.js at 4.6MB, physx-js-webidl.wasm at 5.9MB) but are never copied to the CDN container.

What I Tried

  1. Manually copied both files into the CDN container:
  2. After copying, http://localhost:8080/web/physx-js-webidl.js serves correctly and http://localhost:8080/web/physx-js-webidl.wasm downloads successfully (5.9MB)
  3. The "Failed to load PhysX script" error goes away after copying the JS file
  4. However, "PhysX WASM loading timeout after 30 seconds" still occurs — the JS loads but WASM initialization times out

Steps to Reproduce

  1. Fresh clone on Windows
  2. bun install
  3. Copy .env files for server and client
  4. bun run cdn:up
  5. bun run dev
  6. Open http://localhost:3333 — stuck at 3%

Expected

PhysX files should be automatically available in the CDN container after setup, and the game should load past 3%.

Setup completed

  • bun install
  • packages/server/.env created ✅
  • packages/client/.env created ✅
  • Docker running ✅
  • PostgreSQL running ✅
  • bunx drizzle-kit push (tables created) ✅
  • Server shows "Hyperscape Server Ready" ✅
  • PhysX files exist in physx-js-webidl/dist/ ✅

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