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

ZSH: trace trap ./apollo-ios-cli generate #3124

Closed
xLuciferSx opened this issue Jul 16, 2023 · 6 comments
Closed

ZSH: trace trap ./apollo-ios-cli generate #3124

xLuciferSx opened this issue Jul 16, 2023 · 6 comments
Labels
bug Generally incorrect behavior needs investigation

Comments

@xLuciferSx
Copy link

xLuciferSx commented Jul 16, 2023

Summary

I am currently on Apollo 1.3.1(iOS) and i am unable to generate the GraphQL files for the reason bellow.

ApolloCodegenLib/JavaScriptBridge.swift:343: Precondition failed: Expected JavaScript array but found: undefined
zsh: trace trap ./apollo-ios-cli generate

Version

1.3.1

Steps to reproduce the behavior

Download the latest version - 1.3.1
Go in terminal to your SPM and type the command - ./apollo-ios-cli generate

Screenshot 2023-07-16 at 18 00 09

Logs

No response

Anything else?

Mac Studio M2 Max. Mac OS Ventura 13.4.1

@xLuciferSx xLuciferSx added bug Generally incorrect behavior needs investigation labels Jul 16, 2023
@MaxFritzhand
Copy link

Facing this issue too

@xLuciferSx
Copy link
Author

I've tried to downgrade to 1.2.0 and 1.0.6. All off this started on 1.0.6 and i thought that it might be related to Apollo being outdated but apparently it happens on every version.

@BobaFetters
Copy link
Member

@xLuciferSx @MaxFritzhand There is likely something in your schema or an operation that is unexpected, we had an issue like this reported not long ago #3047 I recommend checking out that issue and using the sample project that @calvincestari provided to be able to breakpoint and debug specifically what the issue is.

Alternatively if you are able to share your schema/operations privately we can assist in debugging, if so you can send them to zach.fetters[at]apollographql.com

@xLuciferSx
Copy link
Author

xLuciferSx commented Jul 17, 2023

I've sent you an email. Thank you very much! @BobaFetters

@BobaFetters
Copy link
Member

For future reference for others who may experience this issue, OP's issue was related to mismatches between fields defined in schema and fields being used/accessed in operations.

Closing this issue as no work is needed, for anyone experiencing this in the future the recommendation is to use the sample project provided in #3047 to aid in debugging and finding schema/operation issues

@BobaFetters
Copy link
Member

Update on this, after further investigation I discovered an issue with how the errors reported from graphql-js are handled due to a max error limit, this was resulting in the precondition failure instead of getting proper error logs pointing to specific schema/operation issues. We will be updating the handling of the errors to resolve this and that work can be tracked in issue #3126

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Generally incorrect behavior needs investigation
Projects
None yet
Development

No branches or pull requests

3 participants