dabit3 / next.js-amplify-workshop

AWS Amplify Next.js workshop
361 stars 87 forks source link

incorrect paths for aws-exports and graphql #1

Closed rdyar closed 4 years ago

rdyar commented 4 years ago

just a heads up that I got errors initially - Module not found: Can't resolve './aws-exports' - It was in the /src folder not the root. I edited the one place that was calling this to add /src to the path.

Once that worked then I got errors for the graphql path - Module not found: Can't resolve '../graphql/queries' - same thing it was in /src so I just moved it to the root and now it is working.

I'm on windows.

This all new to me so not sure where the path was set wrong.

thanks for the tutorial!

dabit3 commented 4 years ago

Hey, thanks for the heads up here! I'm wondering if the windows paths are not being set up properly. For example:

  1. When you ran "amplify init", did you set the "Source Directory Path:" to "."?
  2. When you ran "amplify push" after creating the API, did you set the path for the GraphQL code generation to ./graphql/*/.js?

If you did do these things then there's probably some issue with windows not setting the file paths correctly that I've not run into just yet.

rdyar commented 4 years ago

1) I see now it was default set to (src) and I chose that, did not notice you had . at the time.

2) I just ran thru again and it has ? Enter the file name pattern of graphql queries, mutations and subscriptions (src\graphql\**\*.js) not sure if it is carrying over what I accepted above - I assume so.

Only other issue I had was on adding cognito - ? Choose the additional authorization types you want to configure for the API: Amazon Cognito User Pool. On my first try I did not notice that while I had the correct choice highlighted I needed to click the space bar to actually select it - your screenshot was very helpful here where it shows the green circle. I had not seen this type of behavior at a command prompt before so I didn't do that initially and got an error.

This was a simple but pretty cool tutorial. I don't have any experience with Amplify or Next.js so it was amazing to see how easy setting up cognito was.

dabit3 commented 4 years ago

Awesome, thank you for this feedback I appreciate you taking the time to discuss! If you have any future questions, feel free to reach out any time.