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

@elysiajs/cors conflicts with @elysiajs/opentelemetry #62

Open
ViniciusCestarii opened this issue Feb 14, 2025 · 0 comments
Open

@elysiajs/cors conflicts with @elysiajs/opentelemetry #62

ViniciusCestarii opened this issue Feb 14, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@ViniciusCestarii
Copy link

ViniciusCestarii commented Feb 14, 2025

What version of Elysia is running?

1.2.12

What platform is your computer?

Windows 10

What steps can reproduce the bug?

Use cors and opentelemtry together. If the cors is set first than openTelemetry it will give 404 when requesting for OPTIONS on prefligth.

Here I fixed it just changing the order

I think the issue is that @elysiajs/opentelemetry overrides the route set by @elysiajs/cors. It’s possible that @elysiajs/cors also overrides something in @elysiajs/opentelemetry, but I haven’t looked into it deeply yet.

What is the expected behavior?

To not override cors routes. Or add a warning for cases using @elysiajs/opentelemetry on the doc

What do you see instead?

Error 404 on preflight

Additional information

I'm using:

"@elysiajs/cors": "1.2.0",
"@elysiajs/opentelemetry": "1.2.0",

Have you try removing the node_modules and bun.lockb and try again yet?

Yes

@ViniciusCestarii ViniciusCestarii added the bug Something isn't working label Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant