rm -rf node_modules package-lock.json npm cache clean --force npm install player-animator@^0.9.9 Cause: Versions before 0.9.9 had incomplete index.d.ts . Your IDE may be using an old cached type. Solution: Delete node_modules and reinstall. Then, explicitly import types:
<script src="https://cdn.skypack.dev/player-animator@0.9.9"></script> <!-- Or using unpkg --> <script src="https://unpkg.com/player-animator@0.9.9/dist/player-animator.min.js"></script> Then access the global PlayerAnimator : install player-animator%2C version 0.9.9 or later.
if (major === 0 && (minor > 9 || (minor === 9 && patch >= 9))) console.log('✅ Player-Animator is version 0.9.9 or later. Ready to use.'); else console.error('❌ Wrong version detected. Run npm install player-animator@^0.9.9 again.'); rm -rf node_modules package-lock
const animatorCanvas = ref(null);
useEffect(() => const animator = new PlayerAnimator( container: canvasRef.current, versionRequirement: '0.9.9' // built-in check ); animator.loadSpriteSheet('/character.png', frameSize: width: 64, height: 64 ); animator.play('idle'); explicitly import types: <
return <canvas ref=canvasRef />;