mydraft-cc / ui

Open source wireframing tool written in typescript, react and redux.
https://mydraft.cc
MIT License
668 stars 111 forks source link

Build issues on Node 20.11.0 #227

Closed sakuk005 closed 9 months ago

sakuk005 commented 9 months ago

The latest commit does not build using the latest Node/TypeScript:

src/wireframes/components/outline/OutlineItem.tsx:89:49 - error TS2749: 'Input' refers to a value, but is being used as a type here. Did you mean 'typeof Input'?

89     const initInput = React.useCallback((event: Input) => {
                                                   ~~~~~

src/wireframes/components/pages/Page.tsx:94:49 - error TS2749: 'Input' refers to a value, but is being used as a type here. Did you mean 'typeof Input'?

94     const initInput = React.useCallback((event: Input) => {
                                                   ~~~~~

src/wireframes/model/actions/ui.ts:10:10 - error TS2614: Module '"antd/lib/message"' has no exported member 'NoticeType'. Did you mean to use 'import NoticeType from "antd/lib/message"' instead?

10 import { NoticeType } from 'antd/lib/message';
            ~~~~~~~~~~

src/wireframes/shapes/utils/svg-renderer2.ts:417:32 - error TS2339: Property 'indexOf' does not exist on type 'string | Promise<string>'.
  Property 'indexOf' does not exist on type 'Promise<string>'.

417                 if (textOrHtml.indexOf('&') >= 0 || textOrHtml.indexOf('<') >= 0) {
                                   ~~~~~~~

src/wireframes/shapes/utils/svg-renderer2.ts:417:64 - error TS2339: Property 'indexOf' does not exist on type 'string | Promise<string>'.
  Property 'indexOf' does not exist on type 'Promise<string>'.

417                 if (textOrHtml.indexOf('&') >= 0 || textOrHtml.indexOf('<') >= 0) {
                                                                   ~~~~~~~

src/wireframes/shapes/utils/svg-renderer2.ts:418:21 - error TS2322: Type 'string | Promise<string>' is not assignable to type 'string'.
  Type 'Promise<string>' is not assignable to type 'string'.

418                     div.innerHTML = textOrHtml;
                        ~~~~~~~~~~~~~

src/wireframes/shapes/utils/svg-renderer2.ts:420:21 - error TS2322: Type 'string | Promise<string>' is not assignable to type 'string'.
  Type 'Promise<string>' is not assignable to type 'string'.

420                     div.innerText = textOrHtml;
                        ~~~~~~~~~~~~~

Steps used to build:

# Clone the repository at 405b4886c8082bb03856b00e953e6924fa6d8737
git clone https://github.com/mydraft-cc/ui.git
git checkout -b feature/buildtest 405b4886c8082bb03856b00e953e6924fa6d8737

# Restore packages, working around the package dependency errors in the current revision
cd ui
npm i --force
npm uninstall react-redux
npm i @types/react-redux

# Build.  This is where the unrecoverable errors occur.
npm run build
SebastianStehle commented 9 months ago

Thanks. I have a pending PR where I updated ant design and fixed a lot of weird things. I will try to get it merged asap.

SebastianStehle commented 9 months ago

I have merged in the PR.

sakuk005 commented 9 months ago

Can confirm the latest revision builds and runs as expected! #230