Closed ashwinikumar07 closed 3 months ago
Hi @ashwinikumar07 thank you for raising this issue.
This seems to be a bundling issue, possibly caused by the versions of your dependencies.
For example, you have aws-amplify@5.3.20
but your @aws-amplify/api@6.0.42
is more up to date and on v6.
I would recommend upgrading your aws-amplify
package if you want to use generateClient
I also noticed that you are using create-react-app
which is no longer being maintained and would recommend upgrading to a more modern bundling tool like vite
If you are starting a new project, you should also check out our Quickstart guide for Amplify Gen 2
https://docs.amplify.aws/react/start/quickstart/
There are template apps that you can use to quickly deploy and have an Amplify Gen 2 backend and/or sandbox environment to work with.
Let me know if that helps!
@chrisbonifacio I tried to upgrade the 'aws-amplify' to 6.4.3. But still getting the same compilation error.
@ashwinikumar07 Would you be able to provide an app that reproduces this issue? The reproduction steps provided do not reproduce the issue because it would only install the latest version of aws-amplify but the issue might be related to bundler configuration because you're using Create React App which is no longer maintained so. If you can, we recommend switching to a modern bundler like Vite.
This seems to be more of a bundler issue than amplify library issue.
Thank @chrisbonifacio for your help. The issue has been resolved by adding the .mjs extension in webpack config file, just before .jsx extension.
Thank @chrisbonifacio for your help. The issue has been resolved by adding the .mjs extension in webpack config file, just before .jsx extension.
Ah, thank you for following up with the solution! Glad you're unblocked 😁
Before opening, please confirm:
JavaScript Framework
React
Amplify APIs
GraphQL API
Amplify Version
v6
Amplify Categories
api
Backend
CDK
Environment information
Describe the bug
I am integrating the aws appsync graphql api with my existing react project. Getting the below compile time error
Expected behavior
The project should build successfully.
Reproduction steps
npm install 'aws-amplify'
Code Snippet
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
"@aws-amplify/api": "^6.0.42", "aws-amplify": "^5.3.20",
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response