Skip to content

Keep --json stdout clean when oxc-parser falls back to WASM on WebContainers #46

Open

Description

@typeweaver

--json mode promises exactly one JSON document on stdout. On StackBlitz WebContainers, oxc-parser's webcontainer-fallback.cjs installs the WASM build during import("oxc-parser") and prints [oxc-parser] Downloading… with console.log. That line lands in front of the JSON, and JSON.parse on the output fails.

Only that environment is affected; native platforms load the binding without output.

Done when: loading the parser can no longer write to stdout (for example, by redirecting console.log to stderr while import("oxc-parser") runs, or by detecting the fallback). A test proves that a parser load that logs does not reach stdout.

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions