question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The source separation by require/import breaks non-esm dependencies

See original GitHub issue

Pixi’s package.json now separates output sources depending on whether import or require was used to import it. This causes issues in webpack with dependencies that were transpiled to umd, as umd will use require statements. If the primary project uses import, then the primary project will load the esm dist, and the dependency will load the cjs dist, causing two different pixi runtimes to be imported and breaking the dependency.

Expected Behavior

Only the /cjs/ or /esm/ sources should be imported into the project.

Current Behavior

Both /cjs/ and /esm/ sources will be imported into the project.

Steps to Reproduce

Create a barebones Webpack 5 project. import both pixi.js and pixi3d. /cjs/ and /esm/ modules are now both loaded into the project.

Environment

  • pixi.js version 6.4.2

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
lunarraidcommented, Jul 5, 2022

Also, @lunarraid have you tried setting a resolve path for “pixi.js” to be the CommonJS unbundle instead? Wondering what the guidance is for folks also bumping into this.

I did try aliasing it and that allowed my barebones repo to function, though that was only if modules use pixi.js. I’d imagine that if you’re importing dependencies, you would have to alias every single subpackage. I ran into some other issues with this method in my larger package but haven’t tracked them down yet. I’m not 100% certain alias is the best way to go as you need to manually alias any possible variation of the imports, but also haven’t yet found the proper way to force either esm or cjs for a dependency. Still digging.

1reaction
jnsmalmcommented, Jul 5, 2022

@lunarraid If Pixi3D would output ESM as well, would that help?

Read more comments on GitHub >

github_iconTop Results From Across the Web

improving source separation by explicitly modeling ...
Specifically, we propose to model the dependencies between different sources within a mix- ture by autoregressively factorizing the conditional probability dis-.
Read more >
Dependency resolution - Parcel
As Parcel builds your source code, it discovers dependencies, which allow code to be broken into separate files and reused in multiple places....
Read more >
Improving Source Separation by Explicitly ... - Papers With Code
We propose a new method for training a supervised source separation system that aims to learn the interdependent relationships between all ...
Read more >
Blind separation of sources that have spatiotemporal variance ...
dependencies, which is in stark contrast to most previous methods. Key words: independent component analysis, blind source separation, dependent.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found