Closed DeniseJames closed 5 days ago
Hey @DeniseJames, Thanks for bringing this up. Have you recently upgraded the @aws-amplify library version? The latest Amplify Gen2 version generates an amplify_outputs.json file. Could you please check your src folder and let us know which file it contains?
@AnilMaktala Thisis my amplify_outputs.json file. My APIs are on east-2, not sure why amplify_outputs chooses east-1:
{ "auth": { "user_pool_id": "us-east-1_se74eImRp", "aws_region": "us-east-1", "user_pool_client_id": "u2j5p2cgq2gqs3ph18m341lhm", "identity_pool_id": "us-east-1:3eb538d4-e4bd-43d8-a5e1-48f7a4698eea", "mfa_methods": [], "standard_required_attributes": [ "email" ], "username_attributes": [ "email" ], "user_verification_types": [ "email" ], "mfa_configuration": "NONE", "password_policy": { "min_length": 8, "require_lowercase": true, "require_numbers": true, "require_symbols": true, "require_uppercase": true }, "unauthenticated_identities_enabled": true }, "data": { "url": "https://s6vxgd7lzbb4to2yptbthleppq.appsync-api.us-east-1.amazonaws.com/graphql", "aws_region": "us-east-1", "api_key": "", "default_authorization_type": "API_KEY", "authorization_types": [ "AMAZON_COGNITO_USER_POOLS", "AWS_IAM" ], "model_introspection": { "version": 1, "models": { "Todo": { "name": "Todo", "fields": { "id": { "name": "id", "isArray": false, "type": "ID", "isRequired": true, "attributes": [] }, "content": { "name": "content", "isArray": false, "type": "String", "isRequired": false, "attributes": [] }, "createdAt": { "name": "createdAt", "isArray": false, "type": "AWSDateTime", "isRequired": false, "attributes": [], "isReadOnly": true }, "updatedAt": { "name": "updatedAt", "isArray": false, "type": "AWSDateTime", "isRequired": false, "attributes": [], "isReadOnly": true } }, "syncable": true, "pluralName": "Todos", "attributes": [ { "type": "model", "properties": {} }, { "type": "auth", "properties": { "rules": [ { "allow": "public", "provider": "apiKey", "operations": [ "create", "update", "delete", "read" ] } ] } } ], "primaryKeyInfo": { "isCustomPrimaryKey": false, "primaryKeyFieldName": "id", "sortKeyFieldNames": [] } } }, "enums": {}, "nonModels": {} } }, "version": "1.1" }
@AnilMaktala I solved the discrepancy by removing aws-exports.js from .gitignore The app deployed
This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.
Environment information
Data packages
Description
'npm run build' runs sucessfully at CLI but fails on AWS Amplify with this error:
172
Completed Backend Build
173
2024-09-11T14:27:11.016Z [INFO]: ## Starting Frontend Build
174
Starting phase: build
175
2024-09-11T14:27:11.017Z [INFO]: # Executing command: npm run build
176
2024-09-11T14:27:11.277Z [INFO]: > amplify-vite-react-template@0.0.0 build
177
178
2024-09-11T14:27:14.807Z [INFO]: src/components/Contact/ContactComponent.tsx(5,23): error TS2307: Cannot find module '../../aws-exports.js' or its corresponding type declarations.
179
2024-09-11T14:27:14.885Z [ERROR]: !!! Build failed
180
2024-09-11T14:27:14.885Z [ERROR]: !!! Error: Command failed with exit code 2
181
2024-09-11T14:27:14.885Z [INFO]: # Starting environment caching...
182
2024-09-11T14:27:14.886Z [INFO]: # Uploading environment cache artifact...
183
2024-09-11T14:27:14.950Z [INFO]: # Uploaded environment cache artifact
184
2024-09-11T14:27:14.950Z [INFO]: # Environment caching completed
C:\Users\Denise\Documents\amplify-social-room>node -v v18.18.0