denoland/deno_blog

"NotFound: No such file or directory" on Deno Deploy

michal-weglarz opened this issue · 2 comments

Hi, I've tried to deploy the minimal blog example to Deno Deploy, but encountered this issue:

Screenshot 2023-01-09 at 23 10 34

I'm pretty new to Deno ecosystem and I'm not sure how I can debug it, especially if I cannot reproduce it on my machine. Locally (deno task dev) works just fine - no issues.

Well, fortunately it didn't take long to find out what happened - I deployed the blog with an empty posts directory and no .md file whatsoever, what caused the above issue to occur.
Maybe it would be a nice idea to improve handling of this error, especially if it's not present when in dev mode.
When run locally without --dev flag and with empty posts dir, I only saw the following error: No such file or directory (os error 2), stat '/Users/michalweglarz/Code/deno-blog/hmr.js', but it's not really that helpful.

I think you have to deploy your where you compile it because it searches for posts directory in the place where compiling happens!