metro-with-symlinks icon indicating copy to clipboard operation
metro-with-symlinks copied to clipboard

Asset paths invalid for symlink packages on metro@^0.47

Open adrianha opened this issue 6 years ago • 7 comments

Hi @MrLoh ,

I got an issue on RN 0.57.2 that asset paths from symlink packages cannot be resolved correctly. I think its related to this issue

Here's the repo to reproduce this issue: https://github.com/adrianha/metro-symlink - Works fine react-native: 0.57.1

https://github.com/adrianha/metro-symlink/tree/0.57.2 - Assets path incorrect react-native: 0.57.2

Any suggestion?

adrianha avatar Oct 11 '18 05:10 adrianha

I suspect this is an issue in metro and can't be fixed using metro options. The only relevant options are around asset transformation and I think configuring those will suffer from the same issue since there doesn't seem to be a granular way to configure the httpServerLocation.

treyp avatar Oct 11 '18 16:10 treyp

I’m not on RN 0.57 yet, so can’t say much. I’ll check once we upgrade, but it might still take a while. Sorry

MrLoh avatar Oct 12 '18 19:10 MrLoh

rn-cli.config.js was renamed to metro.config.js

6pm avatar Jan 21 '19 13:01 6pm

@treyp can you confirm that your this was fixed in #18?

MrLoh avatar Apr 22 '19 23:04 MrLoh

yep, symlinks are working fine for me again. i'm using [email protected] with [email protected] (just published).

i'd suggest trying RN >= 0.59. they were broken for me in 0.57.2 and 0.58.

treyp avatar Apr 23 '19 01:04 treyp

Sorry, that comment was based on my usage of RN 0.59 in iOS only.

I've tried using Android and the issue still exists there. However, I don't think it's something that can be solved with metro config options, so I don't see a path forward for this repo.

Best thing I can suggest is to monitor https://github.com/facebook/metro/issues/290

treyp avatar May 20 '19 22:05 treyp

I'm reopening this for transparency then, since it's not fully solved yet.

MrLoh avatar May 20 '19 22:05 MrLoh