File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 11import { FileSystemRouter } from "bun" ;
22import { NJSON } from "next-json" ;
3+ import { statSync } from "node:fs" ;
34import { join , relative } from "node:path" ;
4- import { Suspense } from "react" ;
55import { renderToReadableStream } from "react-dom/server" ;
66
77export class StaticRouters {
@@ -117,9 +117,9 @@ export async function serveFromDir(config: {
117117 for ( const suffix of suffixes ) {
118118 try {
119119 const pathWithSuffix = join ( basePath , suffix ) ;
120- const file = Bun . file ( pathWithSuffix ) ;
121- if ( await file . exists ( ) ) {
122- return new Response ( Bun . file ( pathWithSuffix ) ) ;
120+ const stat = statSync ( pathWithSuffix ) ;
121+ if ( stat ?. isFile ( ) ) {
122+ return Bun . file ( pathWithSuffix ) ;
123123 }
124124 } catch ( err ) { }
125125 }
You can’t perform that action at this time.
0 commit comments