I have a NextJs project with Typescript, and I use Firebase,
The problem is that I downloaded these packages:
npm install firebase
npm install @types/firebase
But this error is still present in a __app file:
Cannot find module 'firebase/app' or its corresponding type declarations.
import { initializeApp } from ‘firebase/app’;
package.json:
{
"name": "VirtualFairs-web",
"private": true,
"scripts": {
"dev": "yarn svgo && next dev",
"build": "next build",
"start": "next start",
"svgo": "npx svgo --final-newline -q -r -f images/svg/"
},
"dependencies": {
"@admixltd/admix-component-library": "^0.5.17",
"@emotion/cache": "^11.11.0",
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@lottiefiles/react-lottie-player": "^3.5.3",
"@mui/material": "^5.13.3",
"@mui/x-data-grid": "latest",
"@mui/x-date-pickers": "5.0.13",
"@svgr/webpack": "latest",
"@tanstack/react-query": "^5.17.19",
"@types/firebase": "^3.2.1",
"@types/react-slick": "^0.23.13",
"awesome-debounce-promise": "latest",
"classnames": "latest",
"cookies-next": "^4.1.0",
"copy-to-clipboard": "latest",
"dayjs": "latest",
"emoji-picker-react": "^4.9.2",
"firebase": "^10.12.0",
"formik": "^2.4.5",
"leaflet": "latest",
"leaflet-geosearch": "latest",
"material-ui-popup-state": "^5.1.0",
"moment": "^2.30.1",
"mui-modal-provider": "latest",
"next": "latest",
"next-auth": "latest",
"next-http-proxy-middleware": "latest",
"notistack": "latest",
"nprogress": "latest",
"pluralize": "latest",
"polished": "latest",
"react": "^18.2.0",
"react-country-region-selector": "^3.6.1",
"react-country-region-selector-material-ui-new": "^1.5.2",
"react-detect-offline": "^2.4.5",
"react-dom": "latest",
"react-dropzone": "latest",
"react-leaflet": "latest",
"react-lottie": "^1.2.3",
"react-number-format": "<5",
"react-paginate": "^8.2.0",
"react-phone-input-2": "^2.15.1",
"react-player": "^2.14.1",
"react-slick": "^0.29.0",
"react-use-online-status": "^1.2.2",
"react-verification-code-input": "^1.2.9",
"react-video": "^1.5.3",
"react-window": "latest",
"recoil": "^0.7.7",
"rocket-io": "^1.0.2",
"slick-carousel": "^1.8.1",
"socket.io-client": "^4.7.5",
"stylis-plugin-rtl": "latest",
"video-react": "^0.16.0",
"yup": "^1.3.3"
},
"devDependencies": {
"@tanstack/eslint-plugin-query": "^5.17.22",
"@types/leaflet": "latest",
"@types/node": "latest",
"@types/nprogress": "latest",
"@types/pluralize": "latest",
"@types/react": "latest",
"@types/react-dom": "latest",
"@types/react-lottie": "^1.2.10",
"@types/react-swipeable-views": "^0.13.2",
"@types/react-swipeable-views-utils": "^0.13.4",
"@types/stylis": "latest",
"@typescript-eslint/eslint-plugin": "latest",
"@typescript-eslint/parser": "latest",
"eslint": "latest",
"eslint-config-airbnb": "latest",
"eslint-config-airbnb-typescript": "latest",
"eslint-config-next": "latest",
"eslint-config-prettier": "latest",
"eslint-plugin-import": "latest",
"eslint-plugin-prettier": "latest",
"file-loader": "latest",
"intercept-stdout": "latest",
"next-compose-plugins": "latest",
"prettier": "latest",
"react-swipeable-views": "^0.14.0",
"react-swipeable-views-utils": "^0.14.0",
"typescript": "latest"
}
}