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

Context property route is undefined when aot is disabled #898

Open
MatthewAry opened this issue Oct 25, 2024 · 1 comment
Open

Context property route is undefined when aot is disabled #898

MatthewAry opened this issue Oct 25, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@MatthewAry
Copy link
Contributor

MatthewAry commented Oct 25, 2024

What version of Elysia is running?

1.1.23

What platform is your computer?

Darwin 23.6.0 arm64 arm

What steps can reproduce the bug?

You can create a simple server like this:

const app = new Elysia({
  aot: false
})
  .get('/hi', ({ route }) => `Hello World ${route}`)

app.listen(3000)

What is the expected behavior?

The route property in the context should not be undefined even when aot is set to false.

What do you see instead?

When you hit the endpoint, you should see Hello World undefined as the response.
Setting aot to true will return Hello World /hi

@MatthewAry MatthewAry added the bug Something isn't working label Oct 25, 2024
@adaosantos
Copy link

When aot is enabled the route is also missing at version 1.2.6

const app = new Elysia()
    .use(
        opentelemetry({
            resource: otelConfig.resource,
            spanProcessors: [
                new BatchSpanProcessor(
                    new OTLPTraceExporter({
                        url: env.OTEL_EXPORTER_OTLP_ENDPOINT,
                    }),
                ),
            ],
        }),
    )
    .decorate("logger", logger)
    .use(swagger())
    .use(notificationsApp)
    .get("/health", () => ({ status: "OK" }))
    .listen(3000);

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

3 participants
@MatthewAry @adaosantos and others