Closed reda-alaoui closed 3 years ago
According to https://github.com/microsoft/TypeScript/issues/45236#issuecomment-889188097, this can also be fixed by disabling useDefineForClassFields
.
"target": "esnext" is a mistake. We'd gladly accept a PR to change it to "es2020" (which is supported by Node.js 12 and later, and doesn't set useDefineForClassFields)
Thank you. Do you know when I can expect an image-js
release including this fix?
Just to know if I need to fix it myself until then.
Is far as I know, there doesn't need to be an image-js
release. You should be able to upgrade using npm update
on your side, because the version is compatible with the range used in image-js
: https://github.com/image-js/image-js/blob/93d3cce18279cf1efe82a0e39f288d2276036959/package.json#L104
Ok I just saw that. Thanks again !
I don't know if you saw it but the release seems to have failed.
Thanks, I'm working on it 😄
It should be fine now.
Hello,
I am trying to use image-js with ESM from an Angular application. I get the following error:
If I take a look at tiff/lib-esm/tiffDecoder.js, I see:
_nextIFD
declaration is not supported by the bundler.This is the config used by tiff library:
So I guess JS class variable declaration is only supported in a future ECMAScript version.
Changing the TS target to
es2017
fixes the issue. Would you accept a PR for this?