I'm upgrading my working project from pixi v6 to v7, with all the plugins. I have this error, when I try to do new Spine instance. I followed instructions I've found here in similar issues (set target: es6 in ts config) and it's not working in my case. I know the problem is there's native and transpiled code. I know maybe it can be solved by using babel, but I have no idea how, since I'm not familiar with the building, bundling or typescript stuff..
I'm I missing something? .. I had pixi v 6.5.9 with pixi-spine 3.0.1, custom bundle import with @pixi-spine/runtime4.1 and @pixi-spine/base and it was working ok. Now I have pixi.js v 7.4.2, pixi-spine 4.0.3, I did all necessary changes following migration guide to get it working. The only problem I have, is this error, when creating new Spine instance.
I tried almost everything I could.. Many ways of defining my custom constructor, changing ts settings, attempting to run the babel plugin (but IDK how to use it in my bundler case).. Trying to set target/module compiler property to es6, es2020, it still ends in this error. Previously the module is set to esnext and it was working.
At first, the babel processing suggestion is in that issue for the dragon bones js.. But I have compatible versions of pixi, pixi-spine and assets, I'm not using the Assets loader, I have custom loader, so I construct the spineData according to manual, so I think it should be working.. Why there's this error, I think I'm missing something..
Any help is very appreciated, have a nice day and good luck!
As I can see in the screenshot, the spine code is transpiled.. I'm importing the core like at vendor/spine
export * from "@pixi-spine/runtime-4.1";
export * from "@pixi-spine/base";
and the constructor is:
import { AtlasAttachmentLoader, SkeletonJson, Spine, TextureAtlas } from "vendor/pixi-spine";
let atlas = new TextureAtlas();
atlas.addTexture(id, texture);
let spineAtlasLoader = new AtlasAttachmentLoader(atlas);
let spineJSONParser = new SkeletonJson(spineAtlasLoader);
let spineData = spineJSONParser.readSkeletonData(spineJSON);
let instance = new Spine(spineData)
Sorry, my bad.. I overlooked important thing.. I've updated all packages of pixi and it's plugins, but by mistake forgot to update the @pixi-spine/base ones too.
Hi there,
I'm upgrading my working project from pixi v6 to v7, with all the plugins. I have this error, when I try to do new Spine instance. I followed instructions I've found here in similar issues (set target: es6 in ts config) and it's not working in my case. I know the problem is there's native and transpiled code. I know maybe it can be solved by using babel, but I have no idea how, since I'm not familiar with the building, bundling or typescript stuff..
I'm I missing something? .. I had pixi v 6.5.9 with pixi-spine 3.0.1, custom bundle import with @pixi-spine/runtime4.1 and @pixi-spine/base and it was working ok. Now I have pixi.js v 7.4.2, pixi-spine 4.0.3, I did all necessary changes following migration guide to get it working. The only problem I have, is this error, when creating new Spine instance.
I tried almost everything I could.. Many ways of defining my custom constructor, changing ts settings, attempting to run the babel plugin (but IDK how to use it in my bundler case).. Trying to set target/module compiler property to es6, es2020, it still ends in this error. Previously the module is set to esnext and it was working.
At first, the babel processing suggestion is in that issue for the dragon bones js.. But I have compatible versions of pixi, pixi-spine and assets, I'm not using the Assets loader, I have custom loader, so I construct the spineData according to manual, so I think it should be working.. Why there's this error, I think I'm missing something..
Any help is very appreciated, have a nice day and good luck!
As I can see in the screenshot, the spine code is transpiled.. I'm importing the core like at vendor/spine
and the constructor is: