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

Workaround for metro monorepo asset issues #5551

Merged
2 commits merged into from
Jul 18, 2020

Conversation

acoates-ms
Copy link
Contributor

@acoates-ms acoates-ms commented Jul 17, 2020

Currently in the playground/E2E app some of the images on the RNTester image page, and within the logbox experience do not show up when debugging. This is due to an issue with metro not able to handle assets that are located outside of the app's package folder, which is often the case in monorepos.

This change applies a workaround that the community uses for this case, which fixes this images within our repo. Hopefully this is something we can look into fixing in metro in the future.

See facebook/metro#290 (comment)

Microsoft Reviewers: Open in CodeFlow

@acoates-ms acoates-ms requested a review from a team as a code owner July 17, 2020 17:32
@acoates-ms acoates-ms added the AutoMerge Causes a PR to be automatically merged once all requirements are passed (label drives bot activity) label Jul 17, 2020
@ghost
Copy link

ghost commented Jul 17, 2020

Hello @acoates-ms!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

Do note that I've been instructed to only help merge pull requests of this repository that have been opened for at least 10 hours. No worries though, I will be back when the time is right! 😉

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@asklar asklar linked an issue Jul 17, 2020 that may be closed by this pull request
@@ -32,6 +32,19 @@ module.exports = {
),
]),
},

// Metro doesn't currently handle assets from other packages within a monorepo. This is the current workaround people use
server: {
Copy link
Member

Choose a reason for hiding this comment

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

just for consideration: Since these are so identical, should we place it in a seperate js file and have something like server: require('../shared.metro.config.js').server

@ghost ghost merged commit 5036f5b into microsoft:master Jul 18, 2020
@acoates-ms acoates-ms deleted the monorepoassets branch August 5, 2020 17:20
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AutoMerge Causes a PR to be automatically merged once all requirements are passed (label drives bot activity)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RNTester Image page "plain static image" is empty
3 participants