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

Navigate to folder public/ throws File must be regular or FIFO error #17

Closed
bogeychan opened this issue Nov 7, 2023 · 2 comments · Fixed by #18
Closed

Navigate to folder public/ throws File must be regular or FIFO error #17

bogeychan opened this issue Nov 7, 2023 · 2 comments · Fixed by #18

Comments

@bogeychan
Copy link
Collaborator

Code to reproduce

import { Elysia } from 'elysia';
import { staticPlugin } from '@elysiajs/static';

new Elysia().use(staticPlugin()).listen(8080);

Folder structure

  • public
    • nested

Navigate to

  • http://localhost:8080/public/
  • http://localhost:8080/public/nested/

Error

EINVAL: File must be regular or FIFO
   path: "public/"
 syscall: "sendfile"
   errno: -22

GET - http://localhost:8080/public/ failed

Environment

  • elysia@0.7.21
  • bun@1.0.9
@bogeychan
Copy link
Collaborator Author

as a workaround one can add ignore patterns for each folder and subfolder like:

Folder structure:

  • public
    • nested
staticPlugin({
  ignorePatterns: [/public\/?/, /public\/nested\/?/]
});

make sure to include the default patterns too:

ignorePatterns = ['.DS_Store', '.git', '.env'],

@tnfAngel
Copy link

Same for me

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

Successfully merging a pull request may close this issue.

2 participants