fix module loading undefined error #12571
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@keybase/react-hackers
So we've been bitten by this error once before, its really a problem with the metro bundler (facebook/metro#152) where if you import a file multiple times it can freak out. In this case we already were importing config-gen (https://github.com/keybase/client/blob/master/shared/actions/teams.js#L25) but then we added another import of config-gen and didn't clean up the second one (https://github.com/keybase/client/blob/master/shared/actions/teams.js#L17). This is kind of annoying and hard to debug or notice.
I think a best practice for us would be to
Updated RN will fix this issue but we're not there yet.
Also we might to relook at a imports sorting eslint plugin again. Ideally it'd sort by file name maybe so its more obvious when this happens and would keep the order stable as we pull more things in (vs sorting based on the contents of the import line)