gqty-dev/gqty

Many Typescript Errors on a fresh Install

Closed this issue · 2 comments

Steps to reproduce:

  • Install NextJS@latest with Typescript
  • npx @gqty/cli

Observed behavior:

  • Y to all
  • Introspection completes
  • No new packages added had to install manually

Remediation attemps:

  • npm install gqty @react/gqty

Versions installed:

"@gqty/react": "^3.0.0-alpha-7b21563c.0"
"gqty":              "^3.0.0-alpha-7b21563c.0"

Errors:

gqty/index.ts:

gqty/index.ts:5:35 - error TS7016: Could not find a declaration file for module './node_modules/@gq
ty/react/index.mjs' implicitly has an 'any' type.
  There are types at './node_modules/@gqty/react/index.d.ts', but this result could not be resolved when respecting packag
e.json "exports". The '@gqty/react' library may need to update its package.json or typings.

5 import { createReactClient } from "@gqty/react";
gqty/index.ts:6:59 - error TS2307: Cannot find module 'Y' or its corresponding type declarations.

6 import { createClient as createSubscriptionsClient } from "Y";
gqty/index.ts:7:67 - error TS7016: Could not find a declaration file for module 'gqty'. './node_modules/gqty/index
.mjs' implicitly has an 'any' type.
  There are types at './node_modules/gqty/index.d.ts', but this result could not be resolved when respecting package.json
"exports". The 'gqty' library may need to update its package.json or typings.

7 import { Cache, GQtyError, createClient, type QueryFetcher } from "gqty";
gqty/index.ts:15:12 - error TS7031: Binding element 'variables' implicitly has an 'any' type.

15   { query, variables, operationName },
              ~~~~~~~~~
15:23 - error TS7031: Binding element 'operationName' implicitly has an 'any' type.

15   { query, variables, operationName },
                         ~~~~~~~~~~~~~
gqty/index.ts:16:3 - error TS7006: Parameter 'fetchOptions' implicitly has an 'any' type.

16   fetchOptions

gqty/schema.generated.ts:

gqty/schema.generated.ts:5:33 - error TS7016: Could not find a declaration file for module 'gqty'. './node_modules
/gqty/index.mjs' implicitly has an 'any' type.
  There are types at 'D:/Code/next-ecomm-wp-fromscratch/node_modules/gqty/index.d.ts', but this result could not be resolved when respecting package.json
"exports". The 'gqty' library may need to update its package.json or typings.

5 import { SchemaUnionsKey } from "gqty";
                                  ~~~~~~
gqty/schema.generated.ts:8350:39 - error TS7016: Could not find a declaration file for module 'gqty'. './node_modules/gqty/index.mjs' implicitly has an 'any' type.
  There are types at './node_modules/gqty/index.d.ts', but this result could not be resolved when respecting package.json
"exports". The 'gqty' library may need to update its package.json or typings.

8350 export const scalarsEnumsHash: import("gqty").ScalarsEnumsHash = {
Errors  Files
     7 gqty/index.ts:5
     2 gqty/schema.generated.ts:5

We moved on to the canary tag from alpha during V3, please try updating and see if it works.

> npm i gqty@canary @gqty/react@canary

We know it is confusing for the moment because we changed that in the middle of V3 development.

Rest assured, the alpha versions will be replaced with V3 when it reaches GA.

It's in the final QA stage, should be out really soon.

Please feel free to reopen if the issue is still here.