yarn tsc command results in "error TS2688: Cannot find type definition file" for 'long' and 'react-responsive'

Author: geunheejungCreated Apr 4, 2025Updated Apr 4, 2025

When running the yarn tsc command, I encounter the following errors:

error TS2688: Cannot find type definition file for 'long'. The file is in the program because: Entry point for implicit type library 'long'

error TS2688: Cannot find type definition file for 'react-responsive'. The file is in the program because: Entry point for implicit type library 'react-responsive'

My current package.json dependencies and devDependencies include:

"dependencies": {
    "@aws-sdk/client-s3": "^3.777.0",
    "@faker-js/faker": "^9.6.0",
    "@floating-ui/react": "^0.27.5",
    "@google-cloud/translate": "^9.0.1",
    "@googlemaps/react-wrapper": "^1.1.42",
    "@reduxjs/toolkit": "^2.6.1",
    "@sentry/nextjs": "^9.10.0",
    "@splidejs/react-splide": "^0.7.12",
    "@tanstack/react-query": "^5.69.0",
    "@tanstack/react-query-devtools": "^5.69.0",
    "@vis.gl/react-google-maps": "^1.5.2",
    "axios": "^1.8.4",
    "classnames": "^2.5.1",
    "clsx": "^2.1.1",
    "cookies-next": "^5.1.0",
    "date-fns": "^4.1.0",
    "dayjs": "^1.11.13",
    "dotenv": "^16.4.7",
    "formik": "^2.4.6",
    "formik-devtools-extension": "^0.1.8",
    "framer-motion": "^12.6.2",
    "i18next": "^24.2.3",
    "jest-environment-jsdom": "^29.7.0",
    "js-levenshtein": "^1.1.6",
    "lodash": "^4.17.21",
    "lottie-react": "^2.4.1",
    "next": "15.2.4",
    "next-auth": "^4.24.11",
    "next-i18next": "^15.4.2",
    "next-redux-wrapper": "^8.1.0",
    "react": "19",
    "react-beautiful-dnd": "^13.1.1",
    "react-cookie-consent": "^9.0.0",
    "react-datepicker": "^8.2.1",
    "react-device-detect": "^2.2.3",
    "react-dom": "19",
    "react-error-boundary": "^5.0.0",
    "react-helmet-async": "^2.0.5",
    "react-i18next": "^15.4.1",
    "react-intersection-observer": "^9.16.0",
    "react-phone-number-input": "^3.4.12",
    "react-query": "^3.39.3",
    "react-redux": "^9.2.0",
    "react-responsive": "^10.0.1",
    "react-select": "^5.10.1",
    "react-step-progress-bar": "^1.0.3",
    "react-switch": "^7.1.0",
    "react-textarea-autosize": "^8.5.8",
    "react-timer-hook": "^4.0.5",
    "react-tooltip": "^5.28.0",
    "redux": "^5.0.1",
    "redux-thunk": "^3.1.0",
    "sharp": "^0.33.5",
    "stripe": "^17.7.0",
    "styled-components": "^6.1.16",
    "swiper": "^11.2.6",
    "swr": "^2.3.3",
    "ts-jest": "^29.3.0",
    "use-debounce": "^10.0.4",
    "use-local-storage-state": "^19.5.0",
    "uuid": "^11.1.0",
    "yup": "^1.6.1"
  },
  "devDependencies": {
    "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
    "@chromatic-com/storybook": "^3.2.6",
    "@eslint/compat": "^1.2.7",
    "@eslint/eslintrc": "^3.3.1",
    "@eslint/js": "^9.23.0",
    "@storybook/addon-essentials": "^8.6.10",
    "@storybook/addon-interactions": "^8.6.10",
    "@storybook/addon-onboarding": "^8.6.10",
    "@storybook/addon-themes": "^8.6.10",
    "@storybook/blocks": "^8.6.10",
    "@storybook/nextjs": "^8.6.10",
    "@storybook/react": "^8.6.10",
    "@storybook/test": "^8.6.10",
    "@svgr/webpack": "^8.1.0",
    "@testing-library/jest-dom": "^6.6.3",
    "@testing-library/react": "^16.2.0",
    "@types/google.maps": "^3.58.1",
    "@types/jest": "^29.5.14",
    "@types/js-levenshtein": "^1.1.3",
    "@types/lodash": "^4.17.16",
    "@types/node": "^22.13.14",
    "@types/node-fetch": "^2.6.12",
    "@types/react": "^19.0.12",
    "@types/react-beautiful-dnd": "^13.1.8",
    "@types/react-dom": "^19.0.4",
    "@types/react-responsive": "^9.0.0",
    "@types/stripe": "^8.0.417",
    "@typescript-eslint/eslint-plugin": "^8.28.0",
    "@typescript-eslint/parser": "^8.28.0",
    "babel-plugin-styled-components": "^2.1.4",
    "eslint": "^9.23.0",
    "eslint-config-eslint": "^11.0.0",
    "eslint-config-prettier": "^10.1.1",
    "eslint-config-react-app": "^7.0.1",
    "eslint-import-resolver-typescript": "^4.2.5",
    "eslint-plugin-import": "^2.31.0",
    "eslint-plugin-jsx-a11y": "^6.10.2",
    "eslint-plugin-prettier": "^5.2.5",
    "eslint-plugin-react": "^7.37.4",
    "eslint-plugin-react-hooks": "^5.2.0",
    "eslint-plugin-storybook": "^0.12.0",
    "globals": "^16.0.0",
    "jest": "^29.7.0",
    "next-transpile-modules": "^10.0.1",
    "prettier": "^3.5.3",
    "sass": "^1.86.0",
    "sb": "^8.6.10",
    "storybook": "^8.6.10",
    "typescript": "5.8.2",
    "typescript-eslint": "^8.28.0",
    "url-loader": "^4.1.1"
  },

Node version: 21.4.0Yarn version: 1.22.x

Could you please clarify the reason behind this error and how to resolve it?

Thank you!

Source: yocontra/react-responsive