79474131

Date: 2025-02-27 23:11:11
Score: 0.5
Natty:
Report link

I had this issue with the file-type package https://www.npmjs.com/package/file-type

In my tsconfig, I have "module": "commonjs", in compilerOptions.

Based on the file-type readme, I needed to import this way using load-esm.

import { loadEsm } from 'load-esm'

const fileType = await loadEsm<typeof import('file-type')>('file-type')

This will require you to first install loadEsm.

yarn add load-esm
Reasons:
  • Blacklisted phrase (0.5): I need
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: ngood97