Open Ateeb-Khan-97 opened 6 months ago
@Ateeb-Khan-97 what is the error you're seeing in the console specifically? :)
I have the same issue, just renders a white screen and this are the errors I'm getting over the console
@lndgalante @Ateeb-Khan-97 would you be able to share a minimal repo to reproduce?
I tried to add cors to the examples/index.ts but I wasnt able to hit this error π
Tried a small codesandbox, and it seems it's related to helmet() in the sandbox at least, https://codesandbox.io/p/devbox/objective-sid-t5pcnk?file=%2Fhttp.ts%3A14%2C1 but locally is the CORS middleware which makes the swagger page go blank
hey appreciate this :) let me investigate π€
okay so short term fix! this works
new Elysia()
.use(cors())
.use(
helmet({
contentSecurityPolicy: {
useDefaults: true,
directives: {
"script-src": ["'self'", "https://cdn.jsdelivr.net/"],
},
},
}),
)
// .use(rateLimit())
.use(swagger())
.get("/", () => "Hello Elysia")
.listen(3000);
but let me find a proper fix : )
@lndgalante @Ateeb-Khan-97 found it πΆβπ«οΈ
https://github.com/elysiajs/elysia-swagger/pull/114
feel free to pull and give this a test :)
Thanks for taking care of this one @marclave, it works for me!
cool let me merge :)
@marclave Thanks man, appreciate it!
I'm running Elysia 1.1.5 and still having the helmet/swagger conflict. Your quick fix works though, thanks for that
@cholasimmons we just need a release, I think @SaltyAom is able to do a release this upcoming week β¨
it was fixed in https://github.com/elysiajs/elysia-swagger/pull/114
I think I recall trying it in a later version of Bun and it worked, but now Bun 1.1.18 and Helmet 2.0.0 is taking me back to the same blank Swagger page
When ever I use elysia swagger with elysiajs/cors plugin swagger page doesn't loads and shows a blank page. When i remove this line
app.use(cors());
it starts to work.version of each pakage are here.
"elysia": "^1.0.9",
"@elysiajs/cors": "^1.0.2"
"@elysiajs/swagger": "^1.0.3"