Skip to content

[Bug]: Empty JSON Files (using RSBuild) #8390

@suryavirkapur

Description

@suryavirkapur

System Info

System:
OS: macOS 14.6.1
CPU: (10) arm64 Apple M1 Pro
Memory: 168.89 MB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 23.1.0 - /opt/homebrew/bin/node
npm: 10.9.0 - /opt/homebrew/bin/npm
pnpm: 9.4.0 - /opt/homebrew/bin/pnpm
bun: 1.1.22 - ~/.bun/bin/bun
Browsers:
Brave Browser: 120.1.61.109
Chrome: 130.0.6723.117
Safari: 17.6

Details

Empty JSON files just crash RSBuild.

> rsbuild dev

  Rsbuild v1.1.0

  ➜ Local:    http://localhost:3000/
  ➜ Network:  http://10.255.254.79:3000/
  ➜ press h + enter to show shortcuts

start   Building...
Panic occurred at runtime. Please file an issue on GitHub with the backtrace below: https://github.com/web-infra-dev/rspack/issues
Message:  should print diagnostics:   × an error occurred when formatting an argument

Location: crates/rspack_core/src/stats/mod.rs:567

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 1: _napi_register_module_v1
    at <unknown source file>
 2: _napi_register_module_v1
    at <unknown source file>
 3: _napi_register_module_v1
    at <unknown source file>
 4: _napi_register_module_v1
    at <unknown source file>
 5: _wasmer_vm_f64_nearest
    at <unknown source file>
 6: _wasmer_vm_f64_nearest
    at <unknown source file>
 7: _napi_register_module_v1
    at <unknown source file>
 8: _napi_register_module_v1
    at <unknown source file>
 9: _napi_register_module_v1
    at <unknown source file>
10: __ZN6v8impl12_GLOBAL__N_123FunctionCallbackWrapper6InvokeERKN2v820FunctionCallbackInfoINS2_5ValueEEE
    at <unknown source file>
 ELIFECYCLE  Command failed.
[1]    18963 abort      RUST_BACKTRACE=full pnpm dev

Reproduce link

https://github.com/suryavirkapur/rsbuild-json-file

Reproduce Steps

  1. Run 'pnpm install' && 'pnpm dev'

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