ecctrl icon indicating copy to clipboard operation
ecctrl copied to clipboard

Build error in nextjs project

Open Abdelkawy16 opened this issue 1 year ago • 3 comments

Checking validity of types ..Failed to compile.

./node_modules/ecctrl/src/EcctrlJoystick.tsx:22:11 Type error: Type 'HTMLDivElement | null' is not assignable to type 'HTMLDivElement'. Type 'null' is not assignable to type 'HTMLDivElement'.

20 | 21 | const [windowSize, setWindowSize] = useState({ innerHeight, innerWidth })

22 | const joystickDiv: HTMLDivElement = document.querySelector("#ecctrl-joystick") | ^ 23 | 24 | /** 25 | * Animation preset Checking validity of types ...

Abdelkawy16 avatar Jun 27 '24 09:06 Abdelkawy16

Try adding this to your tsconfig: "strictNullChecks": false

ErdongChen-Andrew avatar Jun 27 '24 21:06 ErdongChen-Andrew

Would it make sense to refactor ecctrl to not require changing the tsconfig? It's inconvenient for downstream library users to be required change their TS config to a less recommended setting.

avaer avatar Aug 12 '24 10:08 avaer

@avaer

Would it make sense to refactor ecctrl to not require changing the tsconfig? It's inconvenient for downstream library users to be required change their TS config to a less recommended setting.

I agree, this pack was not initially built in TS, those parts are still in progress

ErdongChen-Andrew avatar Aug 12 '24 20:08 ErdongChen-Andrew