AR.js-threejs
AR.js-threejs copied to clipboard
Update Three
When I tried to develop with the latest Three.js, the build failed, so I tried to fix it.
npm audit fix
npm was showing a vulnerability, so I ran npm audit fix
.
up to date, audited 156 packages in 779ms
20 packages are looking for funding
run `npm fund` for details
4 vulnerabilities (2 moderate, 2 high)
To address all issues, run:
npm audit fix
Run `npm audit` for details.
Update Three.js
Updated three.js version to 0.168.0.
npm run build-ts
Upgrading the three.js version caused an error in npm run build-ts
.
ERROR in /Users/matsuyama/src/github.com/AR-js-org/AR.js-threejs/src/ArMarkerControls.ts
./src/ArMarkerControls.ts 348:16-31
[tsl] ERROR in /Users/matsuyama/src/github.com/AR-js-org/AR.js-threejs/src/ArMarkerControls.ts(348,17)
TS2322: Type 'any[]' is not assignable to type 'Matrix4Tuple'.
Target requires 16 element(s) but source may have fewer.
@ ./src/index.ts 7:0-75 28:30-47
matrix.elements was now of type Matrix4Tuple. > 61d6906c18bcbc8086039f73f36413d157be67c2
ERROR in /Users/matsuyama/src/github.com/AR-js-org/AR.js-threejs/src/CommonInterfaces/THREEx-interfaces.ts
26:86-91
[tsl] ERROR in /Users/matsuyama/src/github.com/AR-js-org/AR.js-threejs/src/CommonInterfaces/THREEx-interfaces.ts(26,87)
TS2503: Cannot find namespace 'THREE'.
The THREE namespace was missing. > c6d6cacbb618d0d29292cbf318c9b1a03260f111
ERROR in /Users/matsuyama/src/github.com/AR-js-org/AR.js-threejs/src/ArToolkitContext.ts
./src/ArToolkitContext.ts 102:4-20
[tsl] ERROR in /Users/matsuyama/src/github.com/AR-js-org/AR.js-threejs/src/ArToolkitContext.ts(102,5)
TS2416: Property 'addEventListener' in type 'ArToolkitContext' is not assignable to the same property in base type 'IArToolkitContext'.
Type '<T extends string>(type: T, listener: EventListener<any, T, EventDispatcher<any>>) => void' is not assignable to type '<T extends unknown>(type: T, listener: THREE.EventListener<any, T, THREE.EventDispatcher<any>>) => void'.
Types of parameters 'type' and 'type' are incompatible.
Type 'T' is not assignable to type 'string'.
@ ./src/index.ts 3:0-75 24:30-47
The addEventListener, hasEventListener, and removeEventListener type arguments had to be assigned to string. > c6d6cacbb618d0d29292cbf318c9b1a03260f111
ERROR in /Users/matsuyama/src/github.com/AR-js-org/AR.js-threejs/src/ArMarkerControls.ts
./src/ArMarkerControls.ts 219:27-50
[tsl] ERROR in /Users/matsuyama/src/github.com/AR-js-org/AR.js-threejs/src/ArMarkerControls.ts(219,28)
TS2345: Argument of type '{ type: string; }' is not assignable to parameter of type 'never'.
@ ./src/index.ts 7:0-75 28:30-47
EventDispatcher required a type argument. > a6cb1095cfd55a8efffe15359e8ef0d445a91656