-
Notifications
You must be signed in to change notification settings - Fork 63
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
Cannot use 'in' operator to search for 'name' in amplify codegen [UPDATE] #787
Comments
To confirm, you have added |
Hi @dpilch yes, the issue persisted even when adding the file as an excludes pattern |
I wasn't able to reproduce this. Can you share your If you do not want to share your schema publicly you can use https://docs.amplify.aws/javascript/tools/cli/reference/diagnose/ |
@dpilch I can't share the schema publicly, but here's the identifier Below the
|
I wasn't able to reproduce with any multiline comment, but I could reproduce if the comment included backticks ( Did your comment include backticks? |
@dpilch I've checked the commit, the comment definitely had a pair of backticks inside. So that was the issue then. |
Before opening, please confirm:
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
16.19.0
Amplify CLI Version
12.10.1 / 10.8.1
What operating system are you using?
Mac
Amplify Codegen Command
codegen
Describe the bug
Hello, everyone.
I checked this issue that was opened recently but even with the suggested fix for me it did not work.
I tried to upgrade the CLI to the 12.10.1 but still got the same error.
Cannot use 'in' operator to search for 'name' in amplify codegen
I tried also to downgrade to the
10.8.1
, the error changed to:Then, since the second error was more explicit with the word
parse
I started to look what could be possibly the cause, and I noticed that mycustomQueries.ts
had a multiline comment at the top of the file. I removed the comment and codegen worked.So it seems that the parser was having a bad time parsing the file because I suspect that the
/* */
was expecting a graphql statement and instead it was just a comment.I hope to help someone who will encountered the same issue. If i inspected correctly the code correctly the parsing is done by graphql so It is not an issue releated to codegen itself.
Expected behavior
Maybe it should be said explicitly that the file should have no comments at all.
Reproduction steps
/graphql
folder/*multiline*/
comment at the start of the fileGraphQL schema(s)
# Put schemas below this line
Log output
Additional information
No response
The text was updated successfully, but these errors were encountered: