Open tresorama opened 1 month ago
I presume this is expected behavior, meaning that the SDK is not supposed to work on browser runtime. It's my first time using fern.
In case is not supported, is planned for the future ?
@tresorama can you:
outputEsm
and see if that worksdisable these in your package.json
In package.json of sdk consumer app (next.js) or in the project that generate the sdk ?
- turn on the config flag for outputEsm and see if that works
Where do I add this ?
My current setup
.
├── backend (fastify + fastify-swagger)
│ ├── package.json
│ ├── src
│ │ ├── plugins
│ │ │ └── fastify-swagger
│ │ └── server.ts
│ └── tsconfig.json
├── frontend (next js)
│ ├── next.config.mjs
│ ├── package.json
│ ├── src
│ │ ├── app
│ │ │ ├── dashboard
│ │ │ ├── globals.css
│ │ │ ├── layout.tsx
│ │ ├── auth
│ │ │ └── auth.login.tsx
│ │ └── lib
│ │ ├── fetcher
│ │ ├── react-query.tsx
│ │ └── utils.ts
│ ├── tailwind.config.ts
│ └── tsconfig.json
└── openapi (fern cli )
├── fern
│ ├── fern.config.json
│ ├── generators.yml
│ └── openapi
│ └── openapi.yml
├── package.json
└── sdks
└── typescript
├── Client.d.ts
├── Client.js
├── api
├── core
├── environments.d.ts
├── environments.js
├── errors
├── index.d.ts
├── index.js
└── serialization
Describe the Bug
Trying to use the generated SDK for Typescript inside a React app with Next.js in browser runtime (use client) trigger this error
All working in a Server Component that use Node runtime. Tested only in local dev.
Information to Reproduce
CLI Version
Generator Version
API Definition
Irrelevant.
Actual SDK
Don't know what to write here
Expected SDK
Don't know what to write here