FormidableLabs / groqd

A schema-unaware, runtime and type-safe query builder for GROQ.
https://commerce.nearform.com/open-source/groqd
MIT License
222 stars 17 forks source link

typescript error when using pnpm & turborepo #286

Open adrian-at-stink opened 2 months ago

adrian-at-stink commented 2 months ago

Is there an existing issue for this?

Code of Conduct

Code Sandbox link

No response

Bug report

I'm currently trying out groqd but getting a typescript error below

The inferred type of 'runQuery' cannot be named without a reference to 'groqd/node_modules/zod'. This is likely not portable. A type annotation is necessary.

The code is the same as in the examples:

export const runQuery = makeSafeQueryRunner(
  (query: string, params: Record<string, number | string> = {}) =>
    client.fetch(query, params)

As mentioned in the title, i'm running pnpm and turborepo with a nextjs (14.1.4) app
adrian-at-stink commented 2 months ago

just an update, was looking at https://github.com/microsoft/TypeScript/issues/47663#

and added "declaration": false to the nextjs tsconfig.json

i have shared configs which "declaration": true was set.

not sure what knock on effect this may have