Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error compiling Upload component #24229

Closed
pdeva opened this issue May 17, 2020 · 9 comments · Fixed by #24325
Closed

error compiling Upload component #24229

pdeva opened this issue May 17, 2020 · 9 comments · Fixed by #24325

Comments

@pdeva
Copy link
Contributor

pdeva commented May 17, 2020

  • [ x] I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

http://none.com

Steps to reproduce

yarn tsc

What is expected?

compiles without issues

What is actually happening?

getting this error

$ tsc -v && tsc
Version 3.9.2
node_modules/antd/lib/upload/Upload.d.ts:2:22 - error TS7016: Could not find a declaration file for module 'rc-upload'. 'D:/adcode/dashboard/node_modules/rc-upload/lib/index.js' implicitly has an 'any' type.
  Try `npm install @types/rc-upload` if it exists or add a new declaration (.d.ts) file containing `declare module 'rc-upload';`

2 import RcUpload from 'rc-upload';
                       ~~~~~~~~~~~


Found 1 error.

error Command failed with exit code 2.
Environment Info
antd 4.2.3
React 16.13.1
System windows 10
Browser chrome
@prcdpr
Copy link

prcdpr commented May 17, 2020

I also have that problem

@yingjieg
Copy link

yingjieg commented May 18, 2020

have the same issue

@afc163 afc163 added the 🤔 Need Reproduce We cannot reproduce your problem label May 18, 2020
@ant-design-bot
Copy link
Contributor

Hello @pdeva. Please provide a online reproduction by forking this link https://u.ant.design/codesandbox-repro or a minimal GitHub repository. Issues labeled by Need Reproduce will be closed if no activities in 7 days.

你好 @pdeva, 我们需要你提供一个在线的重现实例以便于我们帮你排查问题。你可以通过点击 此处 创建一个 codesandbox 或者提供一个最小化的 GitHub 仓库。7 天内未跟进的 issue 将会被自动关闭。

@mozkoe
Copy link

mozkoe commented May 18, 2020

Same issue here.
version: antd 4.2.4; eslint 7.0.

"dependencies": {
    "@babel/runtime-corejs3": "^7.9.6",
    "antd": "^4.2.4",
    "react": "^16.13.1",
    "typescript": "^3.9.2"
  },
  "devDependencies": {
    "@babel/cli": "^7.6.4",
    "@babel/core": "^7.9.6",
    "@babel/plugin-transform-runtime": "^7.9.6",
    "@babel/preset-env": "^7.9.6",
    "@babel/preset-react": "^7.9.4",
    "@types/node": "^14.0.1",
    "@types/react": "^16.9.35",
    "@typescript-eslint/eslint-plugin": "^2.33.0",
    "@typescript-eslint/parser": "^2.33.0",
    "babel-eslint": "^10.1.0",
    "babel-loader": "^8.1.0",
    "babel-plugin-import": "^1.13.0",
    "eslint": "^7.0.0",
    "eslint-config-airbnb-base": "^14.1.0",
    "eslint-import-resolver-typescript": "^2.0.0",
    "eslint-loader": "^4.0.0",
    "eslint-plugin-import": "^2.20.2",
    "eslint-plugin-jsdoc": "^25.4.1",
    "eslint-plugin-react": "^7.20.0",
    "fork-ts-checker-webpack-plugin": "^4.1.3",
    "html-webpack-plugin": "^4.3.0",
    "ts-loader": "^7.0.4",
    "ts-node": "^8.10.1",
    "webpack": "^4.43.0",
    "webpack-bundle-analyzer": "^3.7.0",
    "webpack-chain": "^6.4.0",
    "webpack-cli": "^3.3.10",
    "webpack-dev-middleware": "^3.7.2",
    "webpack-hot-middleware": "^2.25.0",
    "webpack-merge": "^4.2.2"
  }

@pavelprokes-avast
Copy link

mee too

@saostad
Copy link

saostad commented May 18, 2020

"antd": "^4.2.4",
"typescript": "^3.9.2"

node_modules/antd/lib/upload/Upload.d.ts:2:22 - error TS7016: Could not find a declaration file for module 'rc-upload'. 

@zenwarr
Copy link

zenwarr commented May 18, 2020

same here, reproducible with antd@4.2.3 and 4.2.4, but not with 4.2.2

@MyCupOfTeaOo
Copy link

MyCupOfTeaOo commented May 19, 2020

image
4.2.4 重现,看了下应该是rc-upload构建没有把d.ts带上导致的吧

@wang3690004
Copy link

me too

[at-loader] ./node_modules/antd/lib/upload/Upload.d.ts:2:22
TS7016: Could not find a declaration file for module 'rc-upload'. 'E:/myownspace/piecesofcode-react/node_modules/rc-upload/lib/index.js' implicitly has an 'any' type.
Try npm install @types/rc-upload if it exists or add a new declaration (.d.ts) file containing declare module 'rc-upload';

and versions : antd:4.2.4 typescript: 3.9.2 @ant-design/icons:4.1.0 react: 16.13.0 "awesome-typescript-loader": "^5.2.1",

@afc163 afc163 removed the 🤔 Need Reproduce We cannot reproduce your problem label May 20, 2020
afc163 added a commit that referenced this issue May 20, 2020
@afc163 afc163 mentioned this issue May 20, 2020
17 tasks
afc163 added a commit that referenced this issue May 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.