stackblitz / webcontainer-core

Dev environments. In your web app.
https://webcontainers.io
MIT License
3.93k stars 171 forks source link

zsing-wasm-demo vite server panics #1609

Open mfulton26 opened 6 days ago

mfulton26 commented 6 days ago

Describe the bug

> zxing-wasm-demo@0.1.0 dev /home/Sec-ant/zxing-wasm-demo
> vite

  VITE v5.4.11  ready in 1830 ms

  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose
  ➜  press h + enter to show help
[vite-plugin-static-copy] Collected 1 items.
✘ [ERROR] panic: runtime error: slice bounds out of range [:-4294967295] (while printing "node_modules/.pnpm/zxing-wasm@1.3.4/node_modules/zxing-wasm/dist/es/reader/index.js")

  debug.Stack (runtime/debug/stack.go:24)
  helpers.PrettyPrintedStack (internal/helpers/stack.go:9)
  linker.(*linkerContext).recoverInternalError (internal/linker/linker.go:7122)
  panic (runtime/panic.go:884)
  js_printer.(*printer).printNonNegativeFloat (internal/js_printer/js_printer.go:3547)
  js_printer.(*printer).printNumber (internal/js_printer/js_printer.go:531)
  js_printer.(*printer).printExpr (internal/js_printer/js_printer.go:3053)
  js_printer.(*binaryExprVisitor).visitRightAndFinish (internal/js_printer/js_printer.go:3404)
  js_printer.(*printer).printExpr (internal/js_printer/js_printer.go:3229)
  js_printer.(*binaryExprVisitor).visitRightAndFinish (internal/js_printer/js_printer.go:3404)
  js_printer.(*printer).printExpr (internal/js_printer/js_printer.go:3254)
  js_printer.(*printer).printIf (internal/js_printer/js_printer.go:3747)
  js_printer.(*printer).printStmt (internal/js_printer/js_printer.go:4290)
  js_printer.(*printer).printBlock (internal/js_printer/js_printer.go:3688)
  js_printer.(*printer).printExpr (internal/js_printer/js_printer.go:2727)
  js_printer.(*printer).printExprWithoutLeadingNewline (internal/js_printer/js_printer.go:1973)
  js_printer.(*printer).printDecls (internal/js_printer/js_printer.go:3659)
  js_printer.(*printer).printDeclStmt (internal/js_printer/js_printer.go:3616)
  js_printer.(*printer).printStmt (internal/js_printer/js_printer.go:4284)
  js_printer.(*printer).printBlock (internal/js_printer/js_printer.go:3688)
  js_printer.(*printer).printFn (internal/js_printer/js_printer.go:907)
  js_printer.(*printer).printExpr (internal/js_printer/js_printer.go:2759)
  js_printer.(*printer).printExprWithoutLeadingNewline (internal/js_printer/js_printer.go:1973)
  js_printer.(*printer).printStmt (internal/js_printer/js_printer.go:4760)
  js_printer.(*printer).printBlock (internal/js_printer/js_printer.go:3688)
  js_printer.(*printer).printExpr (internal/js_printer/js_printer.go:2727)
  js_printer.(*printer).printExpr (internal/js_printer/js_printer.go:2393)
  js_printer.(*printer).printExprWithoutLeadingNewline (internal/js_printer/js_printer.go:1973)
  js_printer.(*printer).printDecls (internal/js_printer/js_printer.go:3659)
  js_printer.(*printer).printDeclStmt (internal/js_printer/js_printer.go:3616)
  js_printer.(*printer).printStmt (internal/js_printer/js_printer.go:4284)
  js_printer.Print (internal/js_printer/js_printer.go:4908)
  linker.(*linkerContext).generateCodeForFileInChunkJS (internal/linker/linker.go:4957)
  linker.(*linkerContext).generateChunkJS (internal/linker/linker.go:5584)

Error: Build failed with 1 error:
error: panic: runtime error: slice bounds out of range [:-4294967295] (while printing "node_modules/.pnpm/zxing-wasm@1.3.4/node_modules/zxing-wasm/dist/es/reader/index.js")
    at failureErrorWithLog (/home/Sec-ant/zxing-wasm-demo/node_modules/.pnpm/esbuild@0.21.5/node_modules/esbuild/lib/main.js:1462:15)
    at eval (/home/Sec-ant/zxing-wasm-demo/node_modules/.pnpm/esbuild@0.21.5/node_modules/esbuild/lib/main.js:935:25)
    at eval (/home/Sec-ant/zxing-wasm-demo/node_modules/.pnpm/esbuild@0.21.5/node_modules/esbuild/lib/main.js:1343:9) {
  errors: [Getter/Setter],
  warnings: [Getter/Setter]
}

Node.js v18.20.3
 ELIFECYCLE  Command failed with exit code 1.

Link to the blitz that caused the error

https://stackblitz.com/~/github.com/Sec-ant/zxing-wasm-demo?view=editor

Steps to reproduce

  1. Open the repo
  2. Load the preview
  3. The server will crash

Expected behavior

The server doesn't crash and the demo page is loaded.

Parity with Local

Screenshots

No response

Platform

Version = 1.84.0
Hash = 3b0b7194bc6b567c2eaf4c96a5759098469dcf59
WebContainer = d3acb9e1

Browser name  = Chrome
Full version  = 131.0.0.0
Major version = 131
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
performance.memory = {
  "totalJSHeapSize": 91369918,
  "usedJSHeapSize": 85753126,
  "jsHeapSizeLimit": 4294705152
}

Additional context

No response