Closed domdomegg closed 1 month ago
Minimal repro here: https://github.com/domdomegg/jimp-1325-mre
That's using react.scripts with is on an old version of jest (27)
Reading through this issue it seems like support for the feature came in jest >28
Could you try updating? If you can't you might be able to write your own custom resolver for jest
Installing Jest 28 (or 29) doesn't seem to change the error, unfortunately.
I got the tests to pass there by using jest-node-exports-resolver
so it indeed does seem to be an issue in jest resolving package exports
This does seem to be fixed in newer versions of jest. I just checked here
Expected Behavior
Can run a basic test with Create React App using Jimp 1.2.0
Current Behavior
Failure Information (for bugs)
The rest of Jimp seems to load perfectly fine in the environment. I don't think I use this plugin, and commenting out line 166 of
jimp/dist/commonjs/index.js
(i.e.var load_font_1 = require("@jimp/plugin-print/load-font");
) makes the tests pass.I think this is a Jimp issue rather than a CRA/Jest issue given that the rest of Jimp works fine in this environment, and it's just this one line it has issue with.
Steps to Reproduce
Context