jaydenseric / extract-files

A function to recursively extract files and their object paths within a value, replacing them with null in a deep clone without mutating the original value. FileList instances are treated as File instance arrays. Files are typically File and Blob instances.
https://npm.im/extract-files
MIT License
56 stars 23 forks source link

imports are broken for @urql/exchange-multipart-fetch #21

Closed PhilippMolitor closed 3 years ago

PhilippMolitor commented 3 years ago

@urql/echange-multipart-fetch has upgraded the extract-files package from version ^8.1.0 to ^11.0.0, which broke an import/export:

yarn run v1.22.11
$ craco build
Creating an optimized production build...
Failed to compile.

/Users/phil/Projects/***redacted***/node_modules/@urql/exchange-multipart-fetch/node_modules/extract-files/public/index.mjs
"export 'default' (reexported as 'ReactNativeFile') was not found in './ReactNativeFile.js'

Version 0.1.12 of @urql/echange-multipart-fetch works fine, 0.1.13 breaks my build process ( create-react-app ).

See: https://github.com/FormidableLabs/urql/pull/1795

jaydenseric commented 3 years ago

Your issue is with create-react-app not bundling correctly, please look for or file an issue there. You can verify that Node.js can import the module just fine…

In test.mjs:

import { ReactNativeFile } from 'extract-files';

// Or:
// import ReactNativeFile from 'extract-files/public/ReactNativeFile.js';

console.log(ReactNativeFile);

Then run node test.mjs.

It's on CRA to ensure perfectly valid Node.js package bundle correctly.