'TypeScript error in directory/node_modules/@antv/g6-core/lib/types/index.d.ts(24,37): Type expected. TS1110
After cloning the repo from GitHub and installing packages by running yarn install, when I'm run the project getting this error. I tried to update react script latest, doesn't work. Also, tried to update typescript 4.1.2 doesn't work.
- Node v: 14.17.3
- Npm v: 6.14.13
- Yarn v: 1.22.10
This is my package.json
{
"name": "zis3-frontend",
"version": "4.6.41.3",
"created": "2022-03-15 20:23:03",
"private": true,
"dependencies": {
"@ant-design/charts": "^1.0.8",
"@ant-design/icons": "^4.1.0",
"@types/i18next": "^13.0.0",
"@types/react-highlight-words": "^0.16.1",
"@types/react-redux": "^7.1.8",
"@types/react-router": "^5.1.7",
"@types/react-router-dom": "^5.1.5",
"antd": "^4.10.2",
"antd-button-color": "^1.0.3",
"antd-mask-input": "^0.1.13",
"array-move": "^4.0.0",
"axios": "^0.19.2",
"fast-xml-parser": "^3.20.3",
"i18next": "17.0.1",
"i18next-browser-languagedetector": "^4.1.1",
"i18next-http-backend": "^1.0.8",
"moment": "^2.25.3",
"node-sass": "4.14.1",
"query-string": "^6.13.0",
"react": "^16.13.1",
"react-csv": "^2.2.2",
"react-dom": "^16.13.1",
"react-highlight-words": "^0.16.0",
"react-i18next": "10.11.0",
"react-icons": "^4.1.0",
"react-json-pretty": "^2.2.0",
"react-quill": "^1.3.5",
"react-redux": "^7.2.0",
"react-router": "^5.1.2",
"react-router-dom": "^5.1.2",
"react-scripts": "^3.4.3",
"react-sortable-hoc": "^2.0.0",
"redux": "^4.0.5",
"redux-thunk": "^2.3.0",
"sweetalert2": "^11.3.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts --max_old_space_size=4096 build && REACT_APP_BUILD_VERSION=$(./ci/get_fe_version.py) && sed -i -- 's/%REACT_APP_BUILD_VERSION%/'$REACT_APP_BUILD_VERSION'/g' build/index.html && echo React Build Version = $REACT_APP_BUILD_VERSION",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"postcssSortingConfig": {
"properties-order": "alphabetical"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"prettier": "2.0.5",
"stylelint": "^13.3.3",
"stylelint-config-sass-guidelines": "^7.0.0",
"stylelint-config-standard": "^20.0.0",
"stylelint-statement-max-nesting-depth": "^2.0.1",
"typescript": "^3.9.7"
}
}
TS Config
{
"compilerOptions": {
"target": "es6",
"module": "esnext",
"jsx": "react",
"lib": ["dom", "dom.iterable", "scripthost", "es5", "es6"],
"baseUrl": "./src",
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"outDir": "./dist",
"rootDir": "./src",
"removeComments": true,
"noEmitOnError": true,
"noImplicitAny": false,
"noLib": false,
"preserveConstEnums": true,
"declaration": false,
"suppressImplicitAnyIndexErrors": true,
"sourceMap": true
},
"filesGlob": ["./src/**/*.ts", "./src/**/*.tsx", "!./node_modules/**"],
"include": ["./src/**/*"],
"exclude": ["node_modules", "**/*.spec.ts"],
"rules": {
"quotemark": "single",
"autoFixOnSave": true
}
}
Solution 1:[1]
Eg. I did the following npm uninstall -D typescript (This uninstalled 3.9.7 version) npm i -D [email protected]
This fixed the problem
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | ratsoe rukawa |