Unable to inspect worker: "worker boot error: Uncaught SyntaxError: Unexpected non-whitespace character after JSON" #456
Closed
Description
Bug report
- I confirm this is a bug with Supabase, not with my own application.
- I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
If I start the main worker with --inspect-main
--inspect-brk
args and import the json file in the main worker code, the following error will occur
2024-12-02T10:52:42.988080Z ERROR ThreadId(03) base::rt_worker::implementation::default_handler: worker boot error: Uncaught SyntaxError: Unexpected non-whitespace character after JSON at position 574 (line 20 column 1)
Error: main worker boot error: worker boot error
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
main worker code:
import { STATUS_CODE } from "jsr:@std/http";
console.log(STATUS_CODE.Accepted);
run edge-runtime with --inspect-main
and --inspect-brk
./target/debug/edge-runtime "$@" start \
--inspect-main \
--inspect-brk \
--main-service ./test-main
Expected behavior
The main worker runs normally and waits for debugging to start
Screenshots
System information
- OS: macOS
Additional context
The reason for the error may be that the inline sourcemap is added to the json file here:
edge-runtime/crates/sb_module_loader/standalone/standalone_module_loader.rs
Lines 264 to 265 in 5707665