Open goodlythink opened 3 months ago
i'm getting a similar issue with staticPlugin, the difference is I'm trying to import a JS file from the public directory.
My project structure:
Below is index.html:
when I run the app using bun dev:
Please kindly advise, cheers!
i found. if set option noCach: true it's can serve static files
.use(staticPlugin({ noCache: true }))
Also suddenly seeing this.
HTTP GET /public/assets/index-CME56wGF.css {} : Error NOT_FOUND
HTTP GET /public/assets/index-EYdG_EqJ.js {} : Error NOT_FOUND
Config:
new Elysia()
.get('/', () => Bun.file('public/index.html'))
.use(staticPlugin())
Files are present:
public/
├── assets
│ ├── Components-BttXgYS5.js
│ ├── Events-DD2it1Vn.js
│ ├── index-CME56wGF.css
│ └── index-EYdG_EqJ.js
├── favicon.ico
├── index.html
└── logo.png
The { noCache: true }
fix doesn't work for me.
what's you elysia version?
Elysia 1.1.11 and @elysiajs/static
1.1.0.
Elysia 1.1.11 and
@elysiajs/static
1.1.0.
I found the issue gone when I downgrade elysia to 1.1.7
I found the issue gone when I downgrade elysia to 1.1.7
Thanks. Will keep this option in mind.
i am on elysia latest version 1.1.13. the problem gone after i renamed the public files and replaced all spaces in the files names with another character. the Space character in the files names was giving this error for me.
I have tried following the example.
and my folder structure
src
when run on browser http://localhost:3000/public/student.png
browser display NOT_FOUND
how to fix
Originally posted by @goodlythink in https://github.com/elysiajs/elysia/discussions/735