Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: v8 ESM is broken with esm.run #10446

Open
plurry opened this issue Apr 14, 2024 · 4 comments
Open

Bug: v8 ESM is broken with esm.run #10446

plurry opened this issue Apr 14, 2024 · 4 comments

Comments

@plurry
Copy link

plurry commented Apr 14, 2024

Current Behavior

#10300 is the closest existing issue I found.

With the ESM build, Pixi 8 won't render anything and doesn't define some variables (like Application.ticker at least).

At first I made an issue with pixi-filters (pixijs/filters#451) because it won't even bundle with esm.run right now, then I moved on to jsDelivr (jsdelivr/jsdelivr#18563) when I saw that esm.sh will at least bundle pixi-filters, but once I tried to use it instead of just loading the module I realized all of Pixi is broken.

Expected Behavior

I don't know anything about the build system and I don't want to mess with it, but using import to load Pixi should work just as well as loading pixi.min.js in a <script> tag.

Steps to Reproduce

Pixi 7 ESM works: https://jsfiddle.net/gxwoqzfb/
Pixi 8 <script> works: https://jsfiddle.net/L0a173qo/
Pixi 8 ESM does not: https://jsfiddle.net/k0nzm8ga/

Environment

  • pixi.js version: 8.1.0
  • Browser & Version: Firefox 123.0.1
  • OS & Version: Arch

Possible Solution

No response

Additional Information

No response

@bigtimebuddy
Copy link
Member

I think it's more of an issue with esm.run. These links works:

https://jsfiddle.net/bigtimebuddy/fwjtc8dq/

This is the ESM build that we ship directly. esm.run is building it on-the-fly.

@bigtimebuddy bigtimebuddy changed the title Bug: v8 ESM is broken Bug: v8 ESM is broken with esm.run Apr 14, 2024
@bigtimebuddy
Copy link
Member

Skypack also works fine:
https://jsfiddle.net/bigtimebuddy/92cyohve/
https://cdn.skypack.dev/pixi.js

I think it's an issue with esm.run.

@plurry
Copy link
Author

plurry commented Apr 14, 2024

Ah, yep!

Even pixi-filters works with Skypack. It was just wanting to upgrade to pixi-filters@6 that got me started with this.

Neither esm.run or esm.sh work but Skypack works fine. I'll reopen the jsDelivr issue.

@bigtimebuddy
Copy link
Member

If you can get more information about what's going on, that would be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants