jasonkuhrt / graffle

Simple GraphQL Client for JavaScript. Minimal. Extensible. Type Safe. Runs everywhere.
http://graffle.js.org/
MIT License
5.83k stars 308 forks source link

error TS2307 when upgraded to version 7.1.0 #1007

Closed laionazeredo closed 2 months ago

laionazeredo commented 2 months ago

Screenshot

image

Description

I use the lib in a NextJS project. It was working well on version 6.1.0. Since I upgraded, I started to get the following error: error TS2307: Cannot find module 'graphql-request' or its corresponding type declarations. The lib stopped to work too, not doing the needed query. Bellow goes my deps and tsconfig:

// package.json

"dependencies": {
    "@amcharts/amcharts4": "^4.10.38",
    "@apollo/client": "^3.7.17",
    "@headlessui/react": "^1.7.17",
    "@heroicons/react": "^2.0.18",
    "@hookform/resolvers": "^3.3.4",
    "@radix-ui/react-accordion": "^1.1.2",
    "@radix-ui/react-checkbox": "^1.0.4",
    "@radix-ui/react-dialog": "^1.0.5",
    "@radix-ui/react-icons": "1.3.0",
    "@radix-ui/react-popover": "^1.0.7",
    "@radix-ui/react-progress": "^1.0.3",
    "@radix-ui/react-radio-group": "^1.1.3",
    "@radix-ui/react-scroll-area": "^1.0.4",
    "@radix-ui/react-toggle-group": "^1.0.4",
    "@radix-ui/react-tooltip": "^1.0.7",
    "@sentry/nextjs": "^7.88.0",
    "@tanstack/react-query": "^5.35.5",
    "@types/react-google-recaptcha": "^2.1.9",
    "axios": "^1.4.0",
    "chart.js": "^4.3.3",
    "date-fns": "^3.6.0",
    "dayjs": "^1.11.10",
    "graphql": "^16.9.0",
    "graphql-request": "^7.1.0",
    "html2canvas": "^1.4.1",
    "jsonwebtoken": "^9.0.2",
    "jspdf": "^2.5.1",
    "lucide-react": "^0.376.0",
    "next": "^14.1.1",
    "next-auth": "^4.22.3",
    "nextjs-google-analytics": "^2.3.3",
    "react": "^18.1.0",
    "react-chartjs-2": "^5.2.0",
    "react-dom": "^18.1.0",
    "react-google-recaptcha": "^3.1.0",
    "react-hook-form": "^7.45.1",
    "react-hot-toast": "^2.4.1",
    "react-hotjar": "^6.2.0",
    "react-multi-select-component": "^4.3.4",
    "react-tailwindcss-datepicker": "^1.6.6",
    "sharp": "^0.32.4",
    "swr": "^2.2.0",
    "winston": "^3.8.1",
    "zod": "^3.22.4",
    "zustand": "^4.5.2",
    "zxcvbn": "^4.4.2"
  },
  "devDependencies": {
    "@faker-js/faker": "^8.1.0",
    "@graphql-codegen/add": "^5.0.3",
    "@graphql-codegen/cli": "5.0.0",
    "@graphql-codegen/client-preset": "4.1.0",
    "@graphql-codegen/typescript-react-apollo": "^3.3.7",
    "@testing-library/jest-dom": "^5.17.0",
    "@testing-library/react": "^14.0.0",
    "@testing-library/user-event": "^14.4.3",
    "@types/jest": "^27.0.1",
    "@types/jsonwebtoken": "^9.0.6",
    "@types/node": "^16.9.1",
    "@types/react": "^18.0.10",
    "@types/react-dom": "^18.0.5",
    "@types/zxcvbn": "^4.4.4",
    "@typescript-eslint/eslint-plugin": "^6.1.0",
    "@typescript-eslint/parser": "^6.1.0",
    "autoprefixer": "^10.4.14",
    "cypress": "^13.9.0",
    "eslint": "^8.45.0",
    "eslint-config-next": "13.4.10",
    "eslint-config-prettier": "^8.8.0",
    "eslint-plugin-only-warn": "^1.1.0",
    "eslint-plugin-react": "^7.32.2",
    "husky": "^8.0.3",
    "jest": "^29.6.1",
    "jest-environment-jsdom": "^29.6.1",
    "lint-staged": "^15.2.0",
    "postcss": "^8.4.24",
    "prettier": "^2.8.8",
    "tailwind-merge": "^1.14.0",
    "tailwindcss": "^3.3.2",
    "ts-node": "^10.2.1",
    "typescript": "^4.3.4"
  },
// tsconfig.json

{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@/components/*": ["components/*"],
      "@/pages/*": ["pages/*"],
      "@/styles/*": ["styles/*"]
    },
    "target": "es5",
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "noEmit": true,
    "esModuleInterop": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve",
    "incremental": true,
    "downlevelIteration": true
  },
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
  "exclude": ["node_modules"]
}

Reproduction Steps/Repo Link

jasonkuhrt commented 2 months ago

I believe this is related to https://github.com/jasonkuhrt/graphql-request/discussions/863. If not, please explain how so.