elysiajs / eden

Fully type-safe Elysia client
MIT License
172 stars 40 forks source link

Vercel/NextJS build fails indicating Elysia is not installed #168

Open rekkisomo opened 3 days ago

rekkisomo commented 3 days ago

What version of Elysia is running?

1.1.24

What platform is your computer?

Microsoft Windows NT 10.0.26120.0 x64

What steps can reproduce the bug?

Admittedly, our setup is unconventional. As we wanted the eden types to be usable by people who don't have access to our server's repository, we have the types built by the server then sent to the repo. This works (and correctly typed) on the client when running the next dev server, as well as passing linting by intellij, but fails linting when being built.

  1. Install Wolfbite-Labs/voyagesdk-ts as a dependency
  2. Do the following in a Next.JS project:
    
    const { vg } = new VoyageSDK()

const server= vg.server.describeServer.get() // ^? returns { availableUserDomains: [], ...} fine, with IDE typing // but building fails indicating no Elysia installed, even though it is.


3. Build using `next build`

### What is the expected behavior?

_No response_

### What do you see instead?

Type error `Property 'pack' does not exist on type '"Please install Elysia before using Eden" & { supabase?: SupabaseClient<any, any, any> | undefined; }'.`
![image](https://github.com/user-attachments/assets/e681a105-9a60-4338-adc0-bb0c44df2499)

IntelliJ linting reports:
![image](https://github.com/user-attachments/assets/6774e677-b092-432c-aa26-7f6efb81be51)

### Additional information

[elysia-autoload](https://github.com/kravetsone/elysia-autoload) is being used as well, but don't believe its an issue there

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

Yes
rekkisomo commented 3 days ago

Using Eden types directly from the server (import {ServerTypes} from "../some-server" instead from the build results in the same issue.