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

errors in node_modules after install #96

Open
diegosystem32 opened this issue Aug 31, 2024 · 2 comments
Open

errors in node_modules after install #96

diegosystem32 opened this issue Aug 31, 2024 · 2 comments

Comments

@diegosystem32
Copy link

Compiled with problems:
×
ERROR in node_modules/ecctrl/src/EcctrlJoystick.tsx:22:11
TS2322: 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
ERROR in node_modules/ecctrl/src/EcctrlJoystick.tsx:119:9
TS18047: 'window.visualViewport' is possibly 'null'.
117 | joystickDiv.addEventListener("touchend", onTouchEnd)
118 |
119 | window.visualViewport.addEventListener("resize", onWindowResize)
| ^^^^^^^^^^^^^^^^^^^^^
120 |
121 | return () => {
122 | joystickDiv.removeEventListener("touchmove", onTouchMove)
ERROR in node_modules/ecctrl/src/EcctrlJoystick.tsx:124:13
TS18047: 'window.visualViewport' is possibly 'null'.
122 | joystickDiv.removeEventListener("touchmove", onTouchMove)
123 | joystickDiv.removeEventListener("touchend", onTouchEnd)
124 | window.visualViewport.removeEventListener("resize", onWindowResize)
| ^^^^^^^^^^^^^^^^^^^^^
125 | }
126 | })
127 |
ERROR in node_modules/ecctrl/src/EcctrlJoystick.tsx:163:11
TS2322: Type 'HTMLDivElement | null' is not assignable to type 'HTMLDivElement'.
Type 'null' is not assignable to type 'HTMLDivElement'.
161 | const buttonTop5Material = useMemo(() => new THREE.MeshNormalMaterial({ transparent: true, opacity: 0.5 }), [])
162 |
163 | const buttonDiv: HTMLDivElement = document.querySelector("#ecctrl-button")
| ^^^^^^^^^
164 |
165 | /**
166 | * Animation preset

@golden-fruit
Copy link

need to do like this : const buttonDiv: HTMLDivElement = document.querySelector("#ecctrl-button")!

@ChristopherTrimboli
Copy link

same, nextjs is completly broken on npm run build only way to fix is fork / PR

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