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

Including a "/" makes an index path that does not work #153

Open
Renato66 opened this issue Oct 11, 2024 · 0 comments
Open

Including a "/" makes an index path that does not work #153

Renato66 opened this issue Oct 11, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Renato66
Copy link

Renato66 commented Oct 11, 2024

What version of Elysia is running?

1.1.20

What platform is your computer?

Darwin 23.6.0 arm64 arm

What steps can reproduce the bug?

for more details: https://github.com/Renato66/elysia-error

with this app:

const app = new Elysia().use(
  cors({
    origin: 'localhost:5173',
  })
  .group('/api', (app) => app
    .group('/company', (app) => app
      .get("/", () => {
        return {
          items: [{id: 1, name: "with slash"}],
          total: 1
        }
      })
    )
  )  
).listen(3000)

will work, but will have typescript errors

const response = await eden.api.company.get()

will not work, but will have all types

const response = await eden.api.company.index.get()

What is the expected behavior?

types from api.company.get() will return api.company.index.get()

What do you see instead?

No response

Additional information

If using group and use functions, like in the repo as example, it will always return as an index in the types

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

No response

@Renato66 Renato66 added the bug Something isn't working label Oct 11, 2024
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