Skip to content

Fix getUUID and URIUtil re-exports #183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

renchap
Copy link

@renchap renchap commented Sep 4, 2022

getUUID and URIUtil are default exports, you need to use the export * as … syntax to re-exports them.

As noted in #136 which made this (incorrect) change, those 2 exports never worked and do not appear in type definitions, so maybe the correct fix is to remove them entirely?

I spotted this by using https://microsoft.github.io/rnx-kit/docs/tools/metro-serializer-esbuild in my project, which uses esbuild to optimise the bundle code, and it error-ed because of this invalid export.

This PR fixes the issue when tested locally with my setup, but again those 2 exports probably never worked so I dont think anybody used them.

Fixes `URIUtil` and `getUUID` re-exports

They are default exports, so we need to use the `export * as …` syntax, otherwise we do not export anything.
flyskywhy added a commit to flyskywhy/PixelShapeRN that referenced this pull request Dec 15, 2022
@flyskywhy
Copy link

No, even this PR can fix react-native-web product build will export 'URIUtil' (reexported as 'URIUtil') was not found, but this PR will cause error when react-native run android:

error: node_modules/react-native-blob-util/index.js: /home/SOME_APP/node_modules/react-native-blob-util/index.js: Export namespace should be first transformed by `@babel/plugin-proposal-export-namespace-from`.
  57 |
  58 | export {ReactNativeBlobUtilConfig, ReactNativeBlobUtilResponseInfo, ReactNativeBlobUtilStream} from './types';
> 59 | export * as URIUtil from './utils/uri';
     |        ^^^^^^^^^^^^
  60 | export {FetchBlobResponse} from './class/ReactNativeBlobUtilBlobResponse';
  61 | export * as getUUID from './utils/uuid';
  62 | export default {

So comes the #201

@RonRadtke RonRadtke closed this Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants