Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type instantiation is excessively deep and possibly infinite #14

Open
RogutKuba opened this issue Jan 22, 2024 · 0 comments
Open

Type instantiation is excessively deep and possibly infinite #14

RogutKuba opened this issue Jan 22, 2024 · 0 comments

Comments

@RogutKuba
Copy link

I get the error Type instantiation is excessively deep and possibly infinite when trying to setup the project using the default setup from the readme.

import { Tinybird } from '@chronark/zod-bird';
import { z } from 'zod';

const tb = new Tinybird({ token: process.env.TINYBIRD_TOKEN! });

export const publishEvent = tb.buildIngestEndpoint({
  datasource: 'events__v1',
  event: z.object({
    id: z.string(),
    tenantId: z.string(),
    channelId: z.string(),
    time: z.number().int(),
    event: z.string(),
    content: z.string().optional().default(''),
    metadata: z.string().optional().default(''),
  }),
});

export const getEvents = tb.buildPipe({
  pipe: 'get_events__v1',
  parameters: z.object({
    tenantId: z.string(),
  }),
  data: z.object({
    event: z.string(),
    time: z.number().transform((t) => new Date(t)),
  }),
});

The code above results in both erroring out and not being typed at all. Am I missing something in my tsconfig or something of that sort?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant