ap0nia / eden-query

🙏 type-safe Elysia.js client with powerful asynchronous state management.
https://ap0nia.github.io/eden-query/
MIT License
37 stars 4 forks source link

Elysia edenPlugin: Type instantiation is excessively deep and possibly infinite #49

Closed Extarys closed 1 month ago

Extarys commented 1 month ago

I had this issue since I first tried eden-query.

When trying to use edenPlugin, ts shows an error and all types are lost client-side for eden.

import { Elysia, t } from "elysia";

import { edenPlugin } from "@ap0nia/eden-svelte-query";

const app = new Elysia()
    .use(edenPlugin({ batch: true }))
    .get("/test", () => {
        return "test"
    });

Error

Type instantiation is excessively deep and possibly infinite.ts(2589)

Type

(alias) edenPlugin<{
    batch: true;
}>(config: {
    batch: true;
}): <BasePath>(elysia: Elysia<BasePath, false, {
    decorator: {};
    store: {};
    derive: {};
    resolve: {};
}, {
    type: {};
    error: {};
}, {
    schema: {};
    macro: {};
    macroFn: {};
}, {}, {
    ...;
}, {
    ...;
}>) => Elysia<...>

Versions

I confirmed that everything is using latest released version.

@ap0nia/eden-svelte-query@"^1.2.0" from @repo/api-elysia@undefined
elysia@1.1.19
ap0nia commented 1 month ago

Could you share a reproduction repo?

Extarys commented 1 month ago

I'll test further, it seems that in my test repo it works. I'll report back here. You can close for now if you wish, and reopen later if needed.

ap0nia commented 1 month ago

You could try removing node_modules and any lock-files like bun.lockb before explicitly installing bun install elysia@1.1.19. Sometimes you can install an older version that still satisfies the package.json versions, and that's preserved in the lockfile.