I am currently working on a new project and here is the content of my package.json file.
{
"name": "dapp-boilerplate",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"format": "prettier --write . --ignore-path .gitignore ./next-env.d.ts",
"typechain": "typechain --target ethers-v5 --out-dir ./contracts/types './contracts/*.json'"
},
"dependencies": {
"@types/": "metamask/providers",
"@types/eslint": "^8.4.8",
"next": "^12.3.1",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@next/eslint-plugin-next": "^13.0.0",
"@typechain/ethers-v5": "^10.1.0",
"@types/node": "^18.11.5",
"@types/react": "^18.0.22",
"@typescript-eslint/eslint-plugin": "^5.41.0",
"@typescript-eslint/parser": "^5.41.0",
"eslint": "^8.26.0",
"eslint-config-next": "^13.0.0",
"eslint-config-prettier": "^8.5.0",
"ethers": "^5.0.31",
"prettier": "2.7.1",
"typechain": "^8.1.0",
"typescript": "^4.1.3"
}
}
Recently, I encountered an issue while running yarn build
. Initially, I suspected it was due to eslint, but that wasn't the case.
Does anyone have a solution for this problem?
yarn run v1.22.19
$ next build
info - Linting and checking validity of types .Failed to compile.
Type error: Cannot find type definition file for '@babel'.
The file is in the program because:
Entry point for implicit type library '@babel'
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Moreover, when attempting to deploy to netlify, I encountered an unexpected error. After running yarn build
, I came across the aforementioned error message.