GithubHelp home page GithubHelp logo

Comments (5)

pointhalo avatar pointhalo commented on May 19, 2024 2

v2.1.0-beta.3 semi相关的ts error已全部修复。
剩余两个属于上游第三方lib的问题,需要skipLibCheckt跳过一下。

node_modules/resize-observer-polyfill/src/index.d.ts:19:18 - error TS2717: Subsequent property declarations must have the same type.  Property 'contentRect' must be of type 'DOMRectReadOnly', but here has type 'DOMRectReadOnly'.

19         readonly contentRect: DOMRectReadOnly;
                    ~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:12122:14
    12122     readonly contentRect: DOMRectReadOnly;
                       ~~~~~~~~~~~
    'contentRect' was also declared here.

from semi-design.

wuhw avatar wuhw commented on May 19, 2024 1

这是个已知问题,在semi个别组件和其依赖的个别第三方lib上存在该问题。近期我们会解决下这个问题

from semi-design.

helloforrestworld avatar helloforrestworld commented on May 19, 2024

新版本还会出现类型报错问题

vite: 3.1.0
react: 17.0.2
semi-ui: 2.19.0

../../node_modules/@douyinfe/semi-ui/_portal/index.tsx:40:5 - error TS2612: Property 'context' will overwrite the base property in 'PureComponent<PortalProps, PortalState, any>'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration.

40     context: ContextValue;
       ~~~~~~~

../../node_modules/@douyinfe/semi-ui/_portal/index.tsx:104:5 - error TS2416: Property 'render' in type 'Portal' is not assignable to the same property in base type 'PureComponent<PortalProps, PortalState, any>'.
  Type '() => ReactPortal' is not assignable to type '() => ReactNode'.
    Type 'ReactPortal' is not assignable to type 'ReactNode'.
      Type 'React.ReactPortal' is not assignable to type 'import("/Users/lizhi/Desktop/my-workspace/node_modules/@types/react/index").ReactPortal'.
        Types of property 'children' are incompatible.
          Type 'React.ReactNode' is not assignable to type 'import("/Users/lizhi/Desktop/my-workspace/node_modules/@types/react/index").ReactNode'.
            Type '{}' is not assignable to type 'ReactNode'.

104     render() {
        ~~~~~~

../../node_modules/@douyinfe/semi-ui/tooltip/index.tsx:29:10 - error TS1205: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.

29 export { TooltipTransitionProps } from './TooltipStyledTransition';
            ~~~~~~~~~~~~~~~~~~~~~~

../../node_modules/@douyinfe/semi-ui/tooltip/index.tsx:182:5 - error TS2612: Property 'foundation' will overwrite the base property in 'BaseComponent<TooltipProps, TooltipState>'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration.

182     foundation: TooltipFoundation;
        ~~~~~~~~~~

../../node_modules/@douyinfe/semi-ui/tooltip/index.tsx:183:5 - error TS2612: Property 'context' will overwrite the base property in 'BaseComponent<TooltipProps, TooltipState>'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration.

183     context: ContextValue;
        ~~~~~~~

../../node_modules/@douyinfe/semi-ui/tooltip/index.tsx:608:14 - error TS2786: 'Portal' cannot be used as a JSX component.
  Its instance type 'Portal' is not a valid JSX element.
    The types returned by 'render()' are incompatible between these types.
      Type 'ReactPortal' is not assignable to type 'ReactNode'.

608             <Portal getPopupContainer={this.props.getPopupContainer} style={{ zIndex }}>
                 ~~~~~~

../../node_modules/@douyinfe/semi-ui/tooltip/index.tsx:738:10 - error TS1205: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.

738 export { Position };
             ~~~~~~~~


Found 7 errors in 2 files.

Errors  Files
     2  ../../node_modules/@douyinfe/semi-ui/_portal/index.tsx:40
     5  ../../node_modules/@douyinfe/semi-ui/tooltip/index.tsx:29
error Command failed with exit code 1.

from semi-design.

pointhalo avatar pointhalo commented on May 19, 2024

新版本还会出现类型报错问题

vite: 3.1.0 react: 17.0.2 semi-ui: 2.19.0

../../node_modules/@douyinfe/semi-ui/_portal/index.tsx:40:5 - error TS2612: Property 'context' will overwrite the base property in 'PureComponent<PortalProps, PortalState, any>'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration.

40     context: ContextValue;
       ~~~~~~~

../../node_modules/@douyinfe/semi-ui/_portal/index.tsx:104:5 - error TS2416: Property 'render' in type 'Portal' is not assignable to the same property in base type 'PureComponent<PortalProps, PortalState, any>'.
  Type '() => ReactPortal' is not assignable to type '() => ReactNode'.
    Type 'ReactPortal' is not assignable to type 'ReactNode'.
      Type 'React.ReactPortal' is not assignable to type 'import("/Users/lizhi/Desktop/my-workspace/node_modules/@types/react/index").ReactPortal'.
        Types of property 'children' are incompatible.
          Type 'React.ReactNode' is not assignable to type 'import("/Users/lizhi/Desktop/my-workspace/node_modules/@types/react/index").ReactNode'.
            Type '{}' is not assignable to type 'ReactNode'.

104     render() {
        ~~~~~~

../../node_modules/@douyinfe/semi-ui/tooltip/index.tsx:29:10 - error TS1205: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.

29 export { TooltipTransitionProps } from './TooltipStyledTransition';
            ~~~~~~~~~~~~~~~~~~~~~~

../../node_modules/@douyinfe/semi-ui/tooltip/index.tsx:182:5 - error TS2612: Property 'foundation' will overwrite the base property in 'BaseComponent<TooltipProps, TooltipState>'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration.

182     foundation: TooltipFoundation;
        ~~~~~~~~~~

../../node_modules/@douyinfe/semi-ui/tooltip/index.tsx:183:5 - error TS2612: Property 'context' will overwrite the base property in 'BaseComponent<TooltipProps, TooltipState>'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration.

183     context: ContextValue;
        ~~~~~~~

../../node_modules/@douyinfe/semi-ui/tooltip/index.tsx:608:14 - error TS2786: 'Portal' cannot be used as a JSX component.
  Its instance type 'Portal' is not a valid JSX element.
    The types returned by 'render()' are incompatible between these types.
      Type 'ReactPortal' is not assignable to type 'ReactNode'.

608             <Portal getPopupContainer={this.props.getPopupContainer} style={{ zIndex }}>
                 ~~~~~~

../../node_modules/@douyinfe/semi-ui/tooltip/index.tsx:738:10 - error TS1205: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.

738 export { Position };
             ~~~~~~~~


Found 7 errors in 2 files.

Errors  Files
     2  ../../node_modules/@douyinfe/semi-ui/_portal/index.tsx:40
     5  ../../node_modules/@douyinfe/semi-ui/tooltip/index.tsx:29
error Command failed with exit code 1.

这个是因为你的项目里存在多个版本的 @types/react(@types/react v18做了breaking change)
A.ReactNode !== B.ReactNode
统一一下再试试。

from semi-design.

pointhalo avatar pointhalo commented on May 19, 2024

image
image

#793

from semi-design.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.