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: compile error without allowSyntheticDefaultImports flag #26484

Closed
pdeva opened this issue Aug 29, 2020 · 4 comments
Closed

regression: compile error without allowSyntheticDefaultImports flag #26484

pdeva opened this issue Aug 29, 2020 · 4 comments
Assignees
Labels
🐛 Bug Ant Design Team had proved that this is a bug.

Comments

@pdeva
Copy link
Contributor

pdeva commented Aug 29, 2020

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

Reproduction link

#25940

Steps to reproduce

create project in typescript that uses antd components.
dont set the "allowSyntheticDefaultImports" flag in tsconfig.json.

/usr/bin/node /usr/share/yarn/bin/yarn.js run ts
yarn run v1.22.5
$ tsc -v && tsc
Version 4.0.2
node_modules/rc-motion/lib/CSSMotion.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-motion/lib/CSSMotionList.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-tooltip/lib/Tooltip.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-tree-select/lib/TreeNode.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-tree-select/lib/interface.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-trigger/lib/index.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.

src/widgets/common/selectableFilterSet.tsx:4:8 - error TS1259: Module '"/home/pdeva/code/dashboard/node_modules/@types/lodash/index"' can only be default-imported using the 'allowSyntheticDefaultImports' flag

4 import _ from "lodash";
         ~

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

src/widgets/common/selectableFilterSet.tsx:15:55 - error TS7006: Parameter 'f' implicitly has an 'any' type.

15     const sortedFilters = _.sortBy(props.allFilters, [f => f.key]);
                                                         ~


Found 8 errors.

error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Process finished with exit code 2

What is expected?

code should compile without errors.
this was reported in #25940 also

What is actually happening?

compiler errors

Environment Info
antd 4.6.1
React 16.13.1
System ubuntu 20
Browser chrome latest
@afc163 afc163 added the 🐛 Bug Ant Design Team had proved that this is a bug. label Aug 31, 2020
@zombieJ
Copy link
Member

zombieJ commented Aug 31, 2020

  • rc-motion
  • rc-tooltip
  • rc-tree-select
  • rc-trigger

zombieJ added a commit to react-component/motion that referenced this issue Aug 31, 2020
zombieJ added a commit to react-component/trigger that referenced this issue Aug 31, 2020
zombieJ added a commit to react-component/tree-select that referenced this issue Aug 31, 2020
zombieJ added a commit to react-component/tree-select that referenced this issue Aug 31, 2020
zombieJ added a commit to react-component/tooltip that referenced this issue Aug 31, 2020
@zombieJ zombieJ closed this as completed Aug 31, 2020
@pdeva
Copy link
Contributor Author

pdeva commented Sep 4, 2020

this is still present in 4.6.2

@zombieJ
Copy link
Member

zombieJ commented Sep 8, 2020

@pdeva could you help to provide fresh list that let me check? Thanks

@kerm1it
Copy link
Member

kerm1it commented Oct 29, 2020

  • rc-notification
  • rc-trigger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Ant Design Team had proved that this is a bug.
Projects
None yet
Development

No branches or pull requests

4 participants