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

Closed
pdeva opened this issue Oct 29, 2020 · 1 comment
Closed
Labels
🐛 Bug Ant Design Team had proved that this is a bug.

Comments

@pdeva
Copy link
Contributor

pdeva commented Oct 29, 2020

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

Reproduction link

#26484

Steps to reproduce

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

node_modules/rc-notification/lib/Notice.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, { Component } 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-notification/lib/Notification.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, { Component, ReactText } 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 7 errors.

What is expected?

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

What is actually happening?

compiler errors

Environment Info
antd 4.7.3
React 16.14.0
System Ubuntu 20.04
Browser Chrome 86
@kerm1it kerm1it added the 🐛 Bug Ant Design Team had proved that this is a bug. label Oct 29, 2020
@kerm1it kerm1it self-assigned this Oct 29, 2020
@kerm1it
Copy link
Member

kerm1it commented Oct 29, 2020

Trace in #26484

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

2 participants