JavaScript/TypeScript code that reproduces the crash?
import { Logger } from "../../lib/logging";
import { Router } from "../../lib/route";
import { Config } from "../configuration/config";
let router_list: Router[] = [];
export let app = {
use: (routes: Router) => {
router_list.push(routes);
}
}
const port = Config.server.port || 4000;
Logger.info("Starting server on port " + port);
export let server = Bun.serve({
port: port,
fetch(req: Request): Response | Promise<Response> | any {
Logger.http(req);
let url: string = new URL(req.url).pathname;
for (let i = 0; i < router_list.length; i++) {
const router = router_list[i];
if(url.startsWith(router.getBaseRoute) || url.startsWith(router.getBaseRoute.slice(0, -1))) {
let router_callback = router.run(req)
if(router_callback != undefined) return router_callback;
}
}
Logger.error("Fallback to default 404")
return new Response(Bun.file("./frontend/views/404.html"), {status: 404});
}
})
Relevant log output
PS Q:\UI Clones\html-css-projects\local-netflix\server> bun --hot index.ts
[info] Starting server on port 3000
GET http://localhost:3000/streams
GET http://localhost:3000/favicon.ico
ERROR: Fallback to default 404
============================================================
Bun v1.1.6 (e58d67b4) Windows x64
Args: "C:\Users\jonij\.bun\bin\bun.exe", "--hot", "index.ts"
Features: abort_signal http_server
Builtins: "bun:main"
Elapsed: 1925ms | User: 15ms | Sys: 0ms
RSS: 0.14GB | Peak: 0.14GB | Commit: 0.23GB | Faults: 33387
panic(main thread): Segmentation fault at address 0xFFFFFFFFFFFFFFFF
oh no: Bun has crashed. This indicates a bug in Bun, not your code.
To send a redacted crash report to Bun's team,
please file a GitHub issue using the link below:
Stack Trace (bun.report)
Bun v1.1.6 (e58d67b) on windows x86_64 [AutoCommand]
How can we reproduce the crash?
Serving an not existing file
JavaScript/TypeScript code that reproduces the crash?
Relevant log output
Stack Trace (bun.report)
Bun v1.1.6 (
e58d67b
) on windows x86_64 [AutoCommand]Segmentation fault at address 0xFFFFFFFFFFFFFFFF
server.zig:2212
:onReadFile
ReadFile.zig:588
:finalize
ReadFile.zig:629
:onFileOpen
blob.zig:1767
:callback
uv__work_done
??
uv_run
uws.zig:2619
:run
JSC__VM__holdAPILock
shimmer.zig:186
:cppFn