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

regression: cannot compile without allowSyntheticDefaultImports flag #32318

Closed
pdeva opened this issue Sep 27, 2021 · 3 comments
Closed

regression: cannot compile without allowSyntheticDefaultImports flag #32318

pdeva opened this issue Sep 27, 2021 · 3 comments
Labels
help wanted The suggestion or request has been accepted, we need you to help us by sending a pull request.

Comments

@pdeva
Copy link
Contributor

pdeva commented Sep 27, 2021

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

Reproduction link

https://jsfiddle.net/afabbro/vrVAP/

Steps to reproduce

Used any version of antd 4.16.9 or higher.
compile with typescript and you will get this error.

What is expected?

it should compile without error. downgrading to 4.16.8 or lower fixes the issue. this issue was introduced since 4.16.9 and is still present in 4.16.13.

What is actually happening?

> tsc -v && tsc -noemit

Version 4.4.3
node_modules/rc-steps/lib/Step.d.ts:1:8 - error TS1259: Module '"/home/pdeva/code/dashboard/node_modules/@types/react/index"' can only be default-imported using the 'allowSyntheticDefaultImports' flag

1 import React from 'react';
         ~~~~~

  node_modules/@types/react/index.d.ts:65:1
    65 export = React;
       ~~~~~~~~~~~~~~~
    This module is declared with using 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag.

node_modules/rc-steps/lib/Steps.d.ts:1:8 - error TS1259: Module '"/home/pdeva/code/dashboard/node_modules/@types/react/index"' can only be default-imported using the 'allowSyntheticDefaultImports' flag

1 import React from 'react';
         ~~~~~

  node_modules/@types/react/index.d.ts:65:1
    65 export = React;
       ~~~~~~~~~~~~~~~
    This module is declared with using 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag.


Found 2 errors.
Environment Info
antd 4.16.13
React 16.14.0
System ubuntu 20.04
Browser not applicable
@afc163 afc163 added the 🤔 Need Reproduce We cannot reproduce your problem label Sep 27, 2021
@github-actions
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 3 days.

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

@pdeva
Copy link
Contributor Author

pdeva commented Sep 27, 2021

this does not need that. read the bug fully

@afc163 afc163 added help wanted The suggestion or request has been accepted, we need you to help us by sending a pull request. and removed 🤔 Need Reproduce We cannot reproduce your problem labels Sep 27, 2021
@github-actions
Copy link
Contributor

Hello @pdeva. We totally like your proposal/feedback, welcome to send us a Pull Request for it. Please send your Pull Request to proper branch (feature branch for the new feature, master for bugfix and other changes), fill the Pull Request Template here, provide changelog/TypeScript/documentation/test cases if needed and make sure CI passed, we will review it soon. We appreciate your effort in advance and looking forward to your contribution!

你好 @pdeva,我们完全同意你的提议/反馈,欢迎直接在此仓库 创建一个 Pull Request 来解决这个问题。请将 Pull Request 发到正确的分支(新特性发到 feature 分支,其他发到 master 分支),务必填写 Pull Request 内的预设模板,提供改动所需相应的 changelog、TypeScript 定义、测试用例、文档等,并确保 CI 通过,我们会尽快进行 Review,提前感谢和期待您的贡献。

giphy

danieldie pushed a commit to danieldie/step-component that referenced this issue Nov 20, 2023
Rubye1998 pushed a commit to Rubye1998/React-step that referenced this issue Aug 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted The suggestion or request has been accepted, we need you to help us by sending a pull request.
Projects
None yet
Development

No branches or pull requests

2 participants