Cannot read properties of undefined (reading 'substr') detectSpineVersion
Opened this issue · 0 comments
ramkrishnakuldeep commented
I have created a custom component for Spine
Initializing a component
import 'pixi-spine';
import { Container, Assets } from 'pixi.js';
import { Spine } from 'pixi-spine';
class CustomSpine extends Container {
constructor(spineAsset, setting) {
super();
this.name = 'Container';
Assets.load(spineAsset).then((resource) => {
console.log(resource);
const spine = new Spine(resource);
spine.skeleton.setSkinByName('default');
spine.skeleton.setSlotsToSetupPose();
spine.visible = true;
spine.position = { x: 0, y: 0 };
spine.alpha = 0.6;
spine.scale.set(1);
spine.state.setAnimation(0, 'ani', false);
spine.interactive = true;
this.addChild(spine);
});
}
}
export default CustomSpine;
Registering the component
renderer.use({
name: 'CustomSpine',
createElement: (props) => new CustomSpine(props.spineAsset, props.setting),
// nextSibling
// insert
// setElementText
// setText
// parentNode
});
adding the compoent to canvas
<custom-spine v-if="player?.emoji" :spineAsset="getEmojiAsset(player.emoji)" ></custom-spine>
But i am getting Spine error
pixi-spine.js?v=aff288ae:21985 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'substr')
at detectSpineVersion (pixi-spine.js?v=aff288ae:21985:24)
at Spine4.createSkeleton (pixi-spine.js?v=aff288ae:22097:17)
at new _SpineBase (pixi-spine.js?v=aff288ae:1184:10)
at new Spine4 (pixi-spine.js?v=aff288ae:22095:14)
at CustomSpine.ts:11:18
my version
"pixi-spine": "^4.0.4",
"pixi.js": "^7.3.2",
Could you please guide me through this issue
Attached is the Skeleton file (.json)