Skip to content

'groq' cannot be used as a value because it was exported using 'export type'. #12104

@maxence-lefebvre

Description

@maxence-lefebvre

Describe the bug

Regression on groq@5.8.1/node_modules/groq/lib/groq.d.cts.

Typecheck (with tsc and tsgo) fails on

await client.fetch(groq`*[...]`, params);

with

src/example.ts - error TS1362: 'groq' cannot be used as a value because it was exported using 'export type'.

           groq`*[...]`
           ~~~~

node_modules/.pnpm/groq@5.8.1/node_modules/groq/lib/groq.d.cts:26:10 - 'groq' was exported here.
    26 export { type groq as default, type defineQuery };

To Reproduce

Steps to reproduce the behavior:

  1. install groq@^5.8.1 @typescript/native-preview
  2. create a file with content
import groq from "groq";

const query = groq`*[]`;
  1. Run pnpm tsgo --noEmit
  2. See error

Expected behavior

groq.d.cts should export the values and not the types, as does groq.d.ts and groq.cjs.

Which versions of Node.js / npm are you running?

node -v && pnpm -v
v22.22.0
10.28.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions