Skip to content

[Bug]: Automerge WASM asset URL contains encoded deploymentId and returns 404 #203

Description

@JasonWenTheFox

Summary

In the official Docker v2.4.0 image, the browser requests the Automerge WASM asset with an URL-encoded ?dpl=... (deploymentId query) embedded into the file name, and the request 404s. This blocks WebAssembly.compile and prevents the encrypted-sync engine from initializing at all.

Steps to reproduce

  1. Deploy ghcr.io/u14app/neo-chat:v2.4.0 via Docker behind a reverse proxy.
  2. Open the app and navigate to Settings → Sync (this triggers loading the Automerge WASM asset).
  3. In the browser network panel or server access log, observe:
GET /_next/static/chunks/<hash>.wasm%3Fdpl%3Dbuild-xxxxxxxx?dpl=build-xxxxxxxx  →  404
  1. The UI shows: Failed to execute 'compile' on 'WebAssembly': HTTP status code is not ok.

The file does exist inside the container:

/app/.next/static/chunks/<hash>.wasm

Requesting the correct URL returns 200 with Content-Type: application/wasm.

Expected behavior

The WASM asset URL should be /_next/static/chunks/<hash>.wasm — the deploymentId, if used, belongs in the query string only, not percent-encoded into the asset file name — so the asset resolves and WebAssembly.compile succeeds.

Actual behavior

The malformed request 404s and sync cannot start. After a minimal nginx rewrite that strips only the encoded ?dpl=... portion from .wasm file names, the same request returns 200 and the WebAssembly error disappears — confirming the URL pollution is the sole cause of the 404.

Environment

Browser: Chrome 151 (macOS 15)
Deployment: official Docker image ghcr.io/u14app/neo-chat:v2.4.0, nginx reverse proxy, Cloudflare Tunnel in front

Logs or screenshots

Access log (client and host redacted):

"GET /_next/static/chunks/3kss9-ir6pd-c.wasm%3Fdpl%3Dbuild-ms9x9138-1cd9e864?dpl=build-ms9x9138-1cd9e864 HTTP/1.1" 404

After stripping only the encoded portion from the path, the same request returns 200, 3380509 bytes, application/wasm.

Investigation leads

  • next.config.ts: deploymentId / NEXT_DEPLOYMENT_ID / NEXT_PUBLIC_DEPLOYMENT_ID
  • Interaction between the deployment-version query Next.js appends to static assets and the dynamic new URL(..., import.meta.url)-style WASM asset URL used by @automerge/automerge — the ?dpl=... suffix appears to end up percent-encoded as part of the asset file name.
  • Not yet reproduced with a local official-image build; the production evidence above is unambiguous.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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