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

errors still being swallowed #2318

Closed
jsphweid opened this issue Aug 9, 2019 · 4 comments
Closed

errors still being swallowed #2318

jsphweid opened this issue Aug 9, 2019 · 4 comments
Labels
core Related to codegen core/cli waiting-for-release Fixed/resolved, and waiting for the next stable release

Comments

@jsphweid
Copy link

jsphweid commented Aug 9, 2019

It appears code errors are still being swallowed. I made a minimal repo showing the issue.

clone this repo: https://github.com/jsphweid/graphql-code-generator-bug
npm i
npm run generate:code

it fails with an unhelpful error message: Failed to load schema from ./src/index.ts. (but WHERE did it fail?!?!)

go to src/Context.ts
comment out the bad import import * as Archive from "../../../raw-archive/src";

run npm run generate:code again. It works.

Why is it hiding the actual code error?

It's really time-consuming to find bugs like this in large codebases. It'd be awesome if this were fixed.

@dotansimha
Copy link
Owner

Hi @jsphweid
We recently did some major changes in the implementation of graphql-toolkit, so it might come from there.
I'll take a look.

Thank you for reporting it!

@dotansimha dotansimha added bug core Related to codegen core/cli labels Aug 11, 2019
@dotansimha dotansimha mentioned this issue Aug 11, 2019
@dotansimha
Copy link
Owner

dotansimha commented Aug 11, 2019

@jsphweid

fixed it in: #2339
can you please try the latest alpha? 1.5.1-alpha-521f8ddf.23

@dotansimha dotansimha added the waiting-for-release Fixed/resolved, and waiting for the next stable release label Aug 11, 2019
@jsphweid
Copy link
Author

jsphweid commented Aug 11, 2019

@dotansimha

Unable to load schema from file "/Users/josephweidinger/Desktop/temp/src/index.ts" due to import error: Cannot find module '../../../raw-archive/src'

much better error!

@dotansimha
Copy link
Owner

Fixed in 1.6.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Related to codegen core/cli waiting-for-release Fixed/resolved, and waiting for the next stable release
Projects
None yet
Development

No branches or pull requests

2 participants