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] Error when using ES Modules with Jimp #1284
Comments
To supplement, using CommonJS to import and access Jimp in Node.js does not cause any errors. The code is as follows: const Jimp = require('jimp');
Jimp; // 👌 All is well |
Same issue and I can't use |
I've been working on v1 and it should support cjs/esm/browser in a much more modern (and working) way |
That's great to hear thank you :) Do you have a tentative timeline, days, weeks, months? From the last commits on that branch, it looks close to done. |
It is pretty close to done. I think by end of the week |
Sounds good. Just to report back, for others that might follow, when I updated my packages I first updated minor + patch and tested before updating major packages. Jimp was one of the minor packages and vite aka esbuild, was one of the major ones. Once I updated both to the latest versions it worked. I just had to change the import to:
|
Expected Behavior
Performing a get operation on Jimp.
Current Behavior
The program throws an error.
Failure Information (for bugs)
If you use CommonJS syntax to import and access Jimp, no error will occur.
If you use ES Modules syntax to import and access Jimp, an error will be thrown, with the error message:
Uncaught TypeError: Class extends value [object Object] is not a constructor or null (at chunk-445PKJEV.js?v=ab5727de:26240:46)
.Steps to Reproduce
Step 1: Install the dependencies;
npm i --save jimp
Step 2: Import and access
Context
The text was updated successfully, but these errors were encountered: