Davide
Hi,
So I did the following but still having error:
- I changed the dependency to
"@esotericsoftware/spine-player": "4.0.28",
. - Changed the code to the following:
const hrefOfSkeleton = '/actions/pokemon/regular/194/action/move.skel'; const targetRef = React.useRef<HTMLDivElement>(null); const playerRef = React.useRef<SpinePlayer>(); React.useEffect(() => { if (!hrefOfSkeleton || !targetRef.current) { return; } console.log('SpinePlayer creation', hrefOfSkeleton); const playerLocal = new SpinePlayer(targetRef.current, { binaryUrl: hrefOfSkeleton, atlasUrl: hrefOfSkeleton.replaceAll('.skel', '.atlas'), }); playerRef.current = playerLocal; return () => playerRef.current?.dispose(); }, [hrefOfSkeleton, targetRef.current]); return <div ref={targetRef}/>;
- Disabled the plugin causing
Removing unpermitted intrinsics
, this is caused by MetaMask. - Close out every other pages of the same app to resolve context disposal issue. It seems like it's simply because I opened too many pages.
Then, I tried with both .json
and .skel
extension, but no luck on my end. This is with strict mode disabled already.
If your code works fine and happen to be React-usable, may I test with your code?
Also, v4.0.28 in TypeScript seems to have some typing issue as simply supplying binaryUrl
and atlasUrl
gives me the following typing error, and if I check the typing, every property of SpinePlayerConfig
is marked as required.
As a side note, pixi-spine
works fine with the same set of files, but missing some parts in the animation.