facebook / facebook/relay

Unable to resolve module `..\\__generated__\\...` in React Native on Windows with artifactDirectory

Open
#3,201 6 comments 2 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
19k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

Reproduction repository using the SWAPI server from here https://github.com/graphql/swapi-graphql.

https://github.com/benmurden/react-native-relay-windows-repro

It seems this issue is related to Windows directory traversal, because things seem to compile fine when generated artifacts are next to files where the query is used. I.e. when `artifactDirectory` is used to collect all relay artifacts, and components are located in another folder up the tree, Babel or Metro seem unable to correctly resolve the artifact file.

### Environment
```
OS: Windows 10
Node: v12.18.3
react: 16.13.1
react-native: 0.63.3
react-relay: 10.0.1
```

![image](https://user-images.githubusercontent.com/213062/95803272-a6a49400-0d3a-11eb-8649-e58169df8ceb.png)

Notice that the output suggests that too many upward directory traversals (`..\\..\\..\\`) are being prepended to the artifact directory.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.