What version of Elysia is running?
- Elysia version: 1.4.18 - Eden Treaty version: 1.4.6
What platform is your computer?
Darwin 25.2.0 arm64 arm
What steps can reproduce the bug?
When defining an Elysia route with a path segment named index and accessing it via Eden Treaty, the index segment is omitted from the final URL.
Reproduction:
Server-side (Elysia):
const app = new Elysia()
.get("/search/index/:indexId/stocks", () => ({ data: [] }));
Client-side (Eden Treaty):
const api = treaty<typeof app>("http://localhost:3000");
await api.search.index({ indexId: "123" }).stocks.get();
// Expected: GET /search/index/123/stocks
// Actual: GET /search/123/stocks
### What is the expected behavior?
The request should be sent to `/search/index/123/stocks`
### What do you see instead?
The request is sent to `/search/123/stocks`, completely omitting the index segment.
### Additional information
## Analysis
It appears Eden Treaty's path builder doesn't properly handle property names that conflict with JavaScript reserved names or built-in object properties. The word index likely conflicts with array/string methods or similar built-in properties, causing the proxy to not intercept it as a path segment.
## Workaround
As a workaround I renamed the path segment to something else (e.g., `/indexx/` instead of `/index/`).
### Have you try removing the `node_modules` and `bun.lockb` and try again yet?
_No response_
What version of Elysia is running?
What platform is your computer?
Darwin 25.2.0 arm64 arm
What steps can reproduce the bug?
When defining an Elysia route with a path segment named index and accessing it via Eden Treaty, the index segment is omitted from the final URL.
Reproduction:
Server-side (Elysia):
Client-side (Eden Treaty):