You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have tried using this plugin in a react app. It works fine when I land at localhost:3000. Routing to something like localhost:3000/dashboard also works fine. But in the routed path if I refresh the page, it just sends, "Not found". I have found the code where it happens.
// https://github.com/oblador/esbuild-server/blob/master/src/index.ts// Attempt to serve file from build or static directoryfor(constdirofstaticDirs){conststaticFilePath=path_1.default.normalize(path_1.default.join(dir,url.pathname==='/' ? 'index.html' : url.pathname));console.log(url.pathname,staticFilePath)if(staticFilePath.startsWith(dir)){try{returnawaitsendFile(res,staticFilePath);}catch(err){if(err.code!=='ENOENT'&&err.code!=='EISDIR'){throwerr;}}}}
It seems it is checking if a directory with the same name as the route path is available or not. If not found it returns "Not found". But in case of SPAs there will be no directory as the route name.
The text was updated successfully, but these errors were encountered:
I have tried using this plugin in a react app. It works fine when I land at
localhost:3000
. Routing to something likelocalhost:3000/dashboard
also works fine. But in the routed path if I refresh the page, it just sends, "Not found". I have found the code where it happens.It seems it is checking if a directory with the same name as the route path is available or not. If not found it returns "Not found". But in case of SPAs there will be no directory as the route name.
The text was updated successfully, but these errors were encountered: