AvetisSargsian Posted April 18, 2022 Share Posted April 18, 2022 Hello, I am trying to load and use spine in my project, but When I am trying to load .skel file Loader defines the type of file incorrectly. explain to me what I am doing wrong, please. Loader.shared.add('ambient', 'assets/art/@1.5x/spine/ambient/ambient.skel') Loader.shared.load(()=>{ const resources = Loader.shared.resources; const { spineData } = resources['ambient_spine']; const spine = new Spine(spineData); Application.STAGE().addChild(spine); }) "pixi-spine": "^3.0.13", "pixi.js": "^6.2.2" , Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted April 18, 2022 Share Posted April 18, 2022 Not sure about "@" symbol in the path, we are using it to recognize resolution, and certain regular expression inside pixi loader might make wrong assumption about file extension. Alternatively, your webserver provides wrong mime type for it Quote Link to comment Share on other sites More sharing options...
AvetisSargsian Posted April 18, 2022 Author Share Posted April 18, 2022 I removed @ symbol and launched the project on chrome and firefox. still same result Quote Link to comment Share on other sites More sharing options...
AvetisSargsian Posted April 18, 2022 Author Share Posted April 18, 2022 one more update to this topic, I was wondering if this happens only with .skel file, I have tried to load spine with .json, and I get same issue. is it may be something wrong with my project setup? Quote Link to comment Share on other sites More sharing options...
AvetisSargsian Posted April 19, 2022 Author Share Posted April 19, 2022 Hello again, so I found how to solve the issue, but I didn't understand why it is happening; In a nutshell, I solve it by adding these 2 lines in the module(file) where I create PIXI.Application Loader.registerPlugin(SpineParser); LoaderResource.setExtensionXhrType('skel', LoaderResource.XHR_RESPONSE_TYPE.BUFFER); I know that pixi-spine is doing these 2 operations when it is loaded to the project, but in my case: Loader._plugins and LoaderResource._xhrTypeMap where the pixi-spine setup happening is different from the Loader and LoaderResource that was used by the pixi app. strange behavior looks like modules of the project loaded in the wrong way, or twice, or from different places...this needs to be investigated. I assume that it is somehow related to webpack config or some other setting in the project, if anyone have any info on this please share :) Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted April 22, 2022 Share Posted April 22, 2022 That looks like usual double-pixi-npm problem. reset everything and it might go away. rm package.lock , node_modules, all that stuff. That's why personally always use UMD versions OK, i'll make sure this bug will be added to the list of "probably npm heck up" Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.