EsotericSoftware / spine-runtimes

2D skeletal animation runtimes for Spine.
http://esotericsoftware.com/
Other
4.42k stars 2.92k forks source link

[ts][pixi-v8] Issue with resolving imports within the package #2685

Closed alvov-evo closed 1 week ago

alvov-evo commented 1 week ago

It seems that since @esotericsoftware/spine-pixi-v8 package has "type": "module" in it's package.json file, all import paths in it must contain file extension, in this case .js.

For example, in SpinePipe.ts:

import { BatchableSpineSlot } from './BatchableSpineSlot';

has to be changed to:

import { BatchableSpineSlot } from './BatchableSpineSlot.js';

From what I see other spine-runtime packages specify .js in their imports, so maybe same approach should be applied for spine-pixi-v8?

In my particular care I get and error from Webpack, which says "<...>the origin is strict EcmaScript Module <...> Add the extension to the request."

Thank you!

davidetan commented 1 week ago

We spotted this yesterday too at the end of the day. I wanted to fix the issue this morning, but you have anticipated me 😁

Thanks for reporting this, I'm going to fix this right now.

davidetan commented 1 week ago

This has been fixed in 1b3194a that is present int release 4.2.66.

alvov-evo commented 1 week ago

That was blazingly fast, I can confirm that the issue is solved in 4.2.66, thank you! 🙇‍♂️