-
Notifications
You must be signed in to change notification settings - Fork 2k
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
@uppy/thumbnail-generator exifr.orientation is not a function #2172
Comments
For some weird reason, For some reason, these seem to work: const exifr = require('exifr') Within the |
Okay, // rollup.config.js
commonjs({
extensions: ['.js', '.cjs']
}), |
Hello, i was about to look into it :D sorry for the inconvinience. Exifr is written as ESM and transpiled to both ESM and UMD. But since the current disarray with js/mjs/cjs and In the PR I decided to go with cjs, but i didn't expect it cause any problem since it would compile and work just fine. Anyway, I'm glad it's fixed 👍 |
Hi ! I have the same error message:
I am using https://github.com/facebook/create-react-app, so I can't change any config, but it does seem like the issue is importing a I have tried replacing the Do you think that CRA should support .cjs imports or is there anything we can do to fix it from this side? Please tell me if you think I should put this in a new issue. Thanks! |
CRA should support .cjs imports, but since it's still causing trouble perhaps we should use the .js import in Uppy for now, until most tools are properly updated. |
I have just created a new CRA project from scratch to isolate the issue and confirmed that there is nothing linked to my project: https://github.com/apuyou/uppy-thumbnail-test Thank you for the suggestion on just changing the extension @goto-bus-stop. I'll open a PR. |
I just commented on this in the #2195 but I'll copy-paste it here for SEO reasons :D Hello, yes I have been looking into it earlier today but hadn't had time to reply yet. I know why the ERR_REQUIRE_ESM error happens. I wrote the library as a forward looking ES module with the new official Funny thing happened here. The solution: I will release new version without What a horrible time to be writing ESM :D |
The error
Upon requesting a thumbnail image, the following error is thrown:
This points to this line:
Related commits
fc3b50a
a6bfd81
@MikeKovarik ?
My code
Versions
Compiled with typescript.
Broken:
Broken:
Working:
The text was updated successfully, but these errors were encountered: