Skip to content
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

fix(storage): browser module resoltuion is not picked up by metro web #13881

Merged
merged 2 commits into from
Oct 3, 2024

Conversation

HuiSF
Copy link
Member

@HuiSF HuiSF commented Oct 3, 2024

Description of changes

Issue #, if available

#13853

Description of how you validated changes

When using the library with Expo, and run npx expo start, observed that the Storage uses fetch instead of xhr for making network requests. This caused that the Storage.get() returns a non Blob, response.Body.

The metro bundler respect the browser module in package.json, but observed it didn't pick up the resolution during testing. The cause is that the module entry doesn't contain an extension name.

Checklist

  • PR description included
  • yarn test passes
  • Unit Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)

Checklist for repo maintainers

  • Verify E2E tests for existing workflows are working as expected or add E2E tests for newly added workflows
  • New source file paths included in this PR have been added to CODEOWNERS, if appropriate

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@HuiSF HuiSF requested a review from a team as a code owner October 3, 2024 02:18
@HuiSF HuiSF force-pushed the hui/fix/v5/storage/browser-metro-module branch from 7c0afdb to a245e90 Compare October 3, 2024 02:19
jimblanc
jimblanc previously approved these changes Oct 3, 2024
Copy link
Member

@AllanZhengYP AllanZhengYP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change makes sense to me. This issue was not found earlier because most bundlers default to esm entry point. We should add the metro web app to our test.

Copy link
Member

@AllanZhengYP AllanZhengYP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change makes sense to me. This issue was not found earlier because most bundlers default to esm entry point. We should add the metro web app to our test.

@HuiSF HuiSF merged commit d49b5b1 into v5-stable Oct 3, 2024
28 checks passed
@HuiSF HuiSF deleted the hui/fix/v5/storage/browser-metro-module branch October 3, 2024 20:05
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