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

Error "Cannot find module '../_.js'" when trying to compile the generated client #1104

Closed
sorenhoyer opened this issue Sep 18, 2024 · 2 comments · Fixed by #1107
Closed

Error "Cannot find module '../_.js'" when trying to compile the generated client #1104

sorenhoyer opened this issue Sep 18, 2024 · 2 comments · Fixed by #1107
Labels

Comments

@sorenhoyer
Copy link

sorenhoyer commented Sep 18, 2024

Screenshot

image

Description

Trying to use the generated approach following the step in the tutorial (but with npx since we're not using npm unfortunately).

npx graffle --schema https://countries.trevorblades.com/graphql works well

A graffile folder is generated with .ts files and imports pointing to .js files

It is created in the root of the website, just like the tutorial suggests.

Also in the root I create a main.ts file, although I assume it could be a module located anywhere. Still, making sure I don't divert more from the docs than necessary (npm being the only one, which I guess should not matter)

When I run npx tsx main.ts I get the error in the screenshot above.

Reproduction Steps/Repo Link

  1. npx graffle --schema https://countries.trevorblades.com/graphql
  2. create main.ts file according to the docs
  3. compile it with npx tsx main.ts
  4. Boom!

If I correct all the import paths inside all the files manually I can get it running.

@jasonkuhrt
Copy link
Member

Thanks, I'll ship a fix tomorrow for this.

@jasonkuhrt
Copy link
Member

jasonkuhrt commented Sep 24, 2024

This PR took me longer than expected #1107 but I finally finished. This issue should be fixed by it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants