pixijs: Bug: The requested module '/npm/@pixi/color@7.2.0-beta/+esm' does not provide an export named 'Color'
Current Behavior
Error message: The requested module ‘/npm/@pixi/color@7.2.0-beta/+esm’ does not provide an export named ‘Color’
Expected Behavior
There should be no errors.
Steps to Reproduce
- Go to https://www.jsdelivr.com/
- Type: pixi
- Select 7.2.0-beta
- Click on ESM button
- Copy this link: https://cdn.jsdelivr.net/npm/pixi.js@7.2.0-beta/+esm
- Use this link to set up Pixi.js with importmap:
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Example</title>
</head>
<body style="caret-color: transparent;">
<canvas id="renderCanvas" width="400" height="400"></canvas>
<!-- Since import maps are not yet supported by all browsers, it is
necessary to add the polyfill es-module-shims.js
Source: https://threejs.org/docs/index.html#manual/en/introduction/Installation -->
<script async src="https://unpkg.com/es-module-shims@1.3.6/dist/es-module-shims.js"></script>
<script type="importmap">
{
"imports": {
"pixi-js": "https://cdn.jsdelivr.net/npm/pixi.js@7.2.0-beta/+esm",
"matter-js": "https://cdn.jsdelivr.net/npm/matter-js@0.19.0/+esm"
}
}
</script>
<script type="module" src="js/main.js"></script>
</body>
</html>
js/main.js
// import * as PIXI from "pixi-js";
import { default as PIXI } from "pixi-js";
import { default as Matter } from "matter-js";
console.log(`Matter.js version: ${Matter.version}`);
console.log(PIXI);
Environment
pixi.jsversion: 7.2.0-beta- Browser & Version: Chrome 110
- OS & Version: Windows 10
- Running Example:
- https://playcode.io/1211309
- https://plnkr.co/edit/cpTRfBpoIdl2ZPto
Possible Solution
No response
Additional Information
No response
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 16 (12 by maintainers)
This has been resolved with 7.2.0-rc: https://jsfiddle.net/bigtimebuddy/5ehL3f6q/
It seems that the cache has been flushed but
7.1.2is still not working, because we accidentally bundledcss-color-namesinto@pixi/utils, with invalid source map, causing https://cdn.jsdelivr.net/npm/@pixi/utils@7.1.2/+esm failed to bundle. So we can only wait for7.2.0now… 😢This is caused by #8798,
@pixi/packages do not declarepeerDependenciesnow, jsDelivr don’t know which version of package to choose, so it use thelatestversion (which is cached as7.2.0-beta).Now we can only wait for jsDelivr flusing its cache to make
@7.1.2work (don’t know how long does it take 😢). For@7.2.0-xxxwe need to wait for final release of@7.2.0to make it work.Update: I manually fixed the dist-tags so 7.2.0-beta.2 should be on
prereleaseand 7.1.2 onlatest