gaurishhs / elysia-ip

Get Client IP Address in Elysia
MIT License
48 stars 9 forks source link

Was there a breaking update? #26

Open W-Lawless opened 3 months ago

W-Lawless commented 3 months ago

Just added this package and attempted to use it as shown in the README.

I get this error from typescript:

No overload matches this call.
  The last overload gave the following error.
    Argument of type '(app: Elysia<"", false, { decorator: {}; store: {}; derive: {}; resolve: {}; }, { type: {}; error: {}; }, { schema: {}; macro: {}; }, {}, { derive: {}; resolve: {}; schema: {}; }, { derive: {}; resolve: {}; schema: {}; }>) => Elysia<...>' is not assignable to parameter of type 'Promise<{ default: AnyElysia; }>'.ts(2769)
index.d.ts(777, 5): The last overload is declared here.
(alias) ip(userOptions?: Partial<Options> | undefined): (app: Elysia<"", false, {
    decorator: {};
    store: {};
    derive: {};
    resolve: {};
}, {
    type: {};
    error: {};
}, {
    schema: {};
    macro: {};
}, {}, {
    ...;
}, {
    ...;
}>) => Elysia<...>

Usage:

import { ip } from "elysia-ip"; const app = new Elysia().use(ip()).get("/", () => ({ message: "Hello Elysia" }));

package json:

"elysia": "latest",

armada45-pixel commented 3 months ago

try remove node_modules and install package again.

rm ./node_modules -rf && bun i
gaurishhs commented 3 months ago

@W-Lawless Does this solve your issue?