Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is a directory (os error 21) - Internal Server Error #318

Closed
Astisme opened this issue Dec 8, 2022 · 6 comments
Closed

Is a directory (os error 21) - Internal Server Error #318

Astisme opened this issue Dec 8, 2022 · 6 comments

Comments

@Astisme
Copy link

Astisme commented Dec 8, 2022

Hello deno!

I'm having a little bit of trouble with the deployment of my Astro website even though I'm pretty sure that it's not their fault as the preview in dev mode works fine.

Currently I'm getting an Internal Server Error when trying to access my website on deno.
Looking through the logs, I get the error in the picture.

Is a directory os error 21

I've followed Astro's instructions to setup deno as the adapter both as an integration and as a deploy medium.

What should I do? Do you need anything to help you solve this case?
The source is laying around on Github
Thanks 🦕

@lino-levan
Copy link

@Astisme It looks like the std version is super out of date. Could you try using

import { serve } from "https://deno.land/[email protected]/http/server.ts";

instead of

import { serve } from "https://deno.land/[email protected]/http/server.ts";

@Astisme
Copy link
Author

Astisme commented Dec 9, 2022

Soo... What if I'm not using that line and instead relying on GH actions to do the work?

Also, as a sidenote, when I use deno run --allow-net --allow-read --allow-env ./dist/server/entry.mjs after building with npx astro build I get this output:

image

So I believe 0.167.0 is already running, right? But then on deno I get the same log as the previous pic (just checked again).

@dsherret dsherret transferred this issue from denoland/deno Dec 9, 2022
@lino-levan
Copy link

ref: withastro/astro#5573

@lino-levan
Copy link

Pretty sure this is an upstream issue, but I think we should keep this open until we can confirm this.

@Astisme
Copy link
Author

Astisme commented Dec 18, 2022

image

I'm still getting the same error after reinstalling the whole project.

I guess this isn't the only fix there is to it.

@Astisme
Copy link
Author

Astisme commented Jan 13, 2023

Ok so basically this is why this error was coming up (it has nothing to do with Deno and only with Astro):

I created a websiteConfig.json file which contained the website name and the favicon name.
I put this file inside the public folder and was then importing it from the files in the src directory.

While I was using npx astro dev, everything was working as expected (I suspect because I was in localhost) but when I then pushed to Deno, the file configuration obviously changes and everything broke.

Fix

The fix here is to use the src/config.ts file for any configuration.

My problem was that I didn't find this file until I created a new Astro project from scratch (not the basic one).

@Astisme Astisme closed this as completed Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants