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

Build error in nextjs project #82

Open
Abdelkawy16 opened this issue Jun 27, 2024 · 3 comments
Open

Build error in nextjs project #82

Abdelkawy16 opened this issue Jun 27, 2024 · 3 comments

Comments

@Abdelkawy16
Copy link

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 ...

@ErdongChen-Andrew
Copy link
Member

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

@avaer
Copy link

avaer commented Aug 12, 2024

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.

@ErdongChen-Andrew
Copy link
Member

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants