I'm working on a strapi.io plugin (typescript) and I would like to use the file-type.
But when I'm trying the example "Determine file type from a Buffer, which may be a portion of the beginning of a file:" from the doc here it does not work. I get:
.../strapi-server.js: require() of ES Module .../node_modules/file-type/index.js from ....myjsfile.js not supported.
Instead change the require of index.js in ...myjsfile.js to a dynamic import() which is available in all CommonJS modules.
I'm not sure if I can change anything since my code runs as a plugin in strapi. And I have no desire to change the strapi code.
Regards
I'm working on a strapi.io plugin (typescript) and I would like to use the file-type. But when I'm trying the example "Determine file type from a Buffer, which may be a portion of the beginning of a file:" from the doc here it does not work. I get: .../strapi-server.js: require() of ES Module .../node_modules/file-type/index.js from ....myjsfile.js not supported. Instead change the require of index.js in ...myjsfile.js to a dynamic import() which is available in all CommonJS modules.
I'm not sure if I can change anything since my code runs as a plugin in strapi. And I have no desire to change the strapi code. Regards