omgovich / colord

👑 A tiny yet powerful tool for high-performance color manipulations and conversions
https://colord.omgovich.ru
MIT License
1.63k stars 48 forks source link

err Error: Default condition should be last one #111

Open ergodic1 opened 10 months ago

ergodic1 commented 10 months ago

While building an app using pixi.js using next, storybook and webpack, I encountered the helpful error err Error: Default condition should be last one emitted as part of the webpack compilation process with no references to files. Investigating, it was suggested on some github issues it was to do with the order of items in package.json:

"import": {
        "default": "./index.mjs",
        "types": "./index.d.ts"
      }

Instead of the suggested order:

"import": {
        "types": "./index.d.ts",
         "default": "./index.mjs"
      }

I managed to find out that @pixi/color was the culprit, so just followed a hunch and searched every plugin it loadeds source and found colord. Changing the order of the values in the package.json sorted the issue.

Is this something that can be fixed here? I have no idea of whether this is going to cause other issues, but thought I would ask.