Closed jstdk closed 1 year ago
"type": "module"
This is required to use this package.
@sindresorhus, I was a deep rabit hole, but it works now with "type": "module"
Got here and found this issue because I just had to downgrade file-type 2 versions.
I think the usage stats on NPM tell you everything you need to know about how the authoritarian ESM migration is going.
16.5.4
is the last CommonJS version of file-type
🤷♂️
Version | Downloads (Last 7 Days) | Tag |
---|---|---|
16.5.4 | 1,950,260 | version-16 |
18.5.0 | 167,986 | latest |
I'm seeing an issue where it will work with Typescript, but not a jest test -- I don't think the right fix there is to set module to true.
npm install file-type@16.5.4
worked for me
I am unable to use this plugin in my Typescript bot as it throws the following error on import:
import { fileTypeFromBuffer } from 'file-type';
Thenconsole.log(await fileTypeFromBuffer(bytes));
Leads to
On SO they advice to add the following to package.json, but that breaks my project altogether
"type": "module"
Thanks for any suggestions