Somehow I can't edit the previous reply. Please delete it. This is my current progress and questions:
Davide
Hi,
So I did the following but still having error:
- I changed the dependency to
"@esotericsoftware/spine-player": "4.0.28",
as well as"@esotericsoftware/spine-core": "4.0.28",
. Without specifyingspine-core
and previous history of installing 4.2, it will stuck at 4.2 causing read error. - 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'), success: () => console.log('success'), error: () => console.log('error'), loading: (_, delta) => console.log('loading', delta), }); 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 of the same app.
Then, it somehow stuck permanently at the loading stage.
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.