Closed JRiggles closed 2 months ago
When trying to include file-types using require syntax
file-types
require
const fileType = require('file-type');
it fails with the following error:
ReferenceError: require is not defined in ES module scope, you can use import instead
I'm working on an existing codebase that uses require, so I can't easily work with
import { fileTypeFromFile } from 'file-type';
Any help / advice is welcome!
https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
Heard, thanks Sindre! I'll see what I can figure out.
When trying to include
file-types
usingrequire
syntaxit fails with the following error:
I'm working on an existing codebase that uses
require
, so I can't easily work withAny help / advice is welcome!