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

relay is failing on windows #231

Closed
sibelius opened this issue Nov 10, 2023 · 6 comments · Fixed by #273
Closed

relay is failing on windows #231

sibelius opened this issue Nov 10, 2023 · 6 comments · Fixed by #273
Assignees

Comments

@sibelius
Copy link

Module not found: Error: Can't resolve '__generated__/PrintersListQuery.graphql.ts' in 'app\src\renderer'
Did you mean './__generated__/PrintersListQuery.graphql.ts'?
Requests that should resolve in the current directory need to start with './'.
Requests that start with a name are treated as module requests and resolve within module directories (node_modules).
If changing the source code is not an option there is also a resolve options called 'preferRelative' which tries to resolve these kind of requests in the current directory too.
@kdy1 kdy1 self-assigned this Nov 16, 2023
@araujobarret
Copy link

araujobarret commented Nov 23, 2023

I have a similar issue in my CircleCI runner and MacOS too:

Cannot find module '/home/circleci/project/src/__generated__/to.graphql.ts' from 'src/app/Scenes/ArtistShows/ArtistShows2.tsx'

where in the original file the imports related imports are:

import { ArtistShows2Query } from "__generated__/ArtistShows2Query.graphql"
import { ArtistShows2_artist$data } from "__generated__/ArtistShows2_artist.graphql"

Without SWC everything is working, just to be clear.

Interesting to point out other tests work, from 269 test files we have(most of them using Relay) only 4 are failing with this error.

@kdy1
Copy link
Member

kdy1 commented Feb 6, 2024

Can you provide a repro?

@sibelius
Copy link
Author

sibelius commented Feb 6, 2024

@kdy1
Copy link
Member

kdy1 commented Feb 8, 2024

Can you provide a minimal reproduction, or at least instructions to see output files?

@sibelius
Copy link
Author

sibelius commented Feb 8, 2024

Here are the instructions

gh clone sibelius/relay-workshop
yarn
yarn relay (generate the artifacts)
yarn web - it will throw error on windows

@freiksenet
Copy link
Contributor

The problem is that it's lacking a ./ at the beginning of import when the actual import has it.

Here is a fix to add option to do it, in case someone depends on the behavior of not having current directory.

#273

@kdy1 kdy1 closed this as completed in #273 Apr 4, 2024
kdy1 pushed a commit that referenced this issue Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

4 participants