sindresorhus / file-type

Detect the file type of a file, stream, or data
MIT License
3.64k stars 345 forks source link

Uncaught SyntaxError: The requested module does not provide an export named 'fileTypeFromBlob' in browser #619

Closed squivix closed 8 months ago

squivix commented 8 months ago

I'm using this library in the broswer with Vite and Vue, and there seems to be certain imports not included for the browser.

When I try to import:

import {fileTypeFromBlob} from "file-type";

I get:

Uncaught SyntaxError: The requested module does not provide an export named 'fileTypeFromBlob' in browser

It seems the export was removed from browser.js in 1c75cfb. I don't know why.

sindresorhus commented 8 months ago

It was not removed. It was simply changed to be re-exported from core.js. The problem here is your Vite config, not this package.