AWS Amplify Deployed Web App Appending Trailing Slash ‘/’

For whatever reason my Amplify hosted web app will no longer let me manually type to navigate to different routes. This is very important as it allows me to work and test different pages that aren’t easily acsessible from navigation bar.

When I click on buttons on the navbar to go to different routes it works correctly. For example when I click home it correctly navigates to “…/home”
The issue arrises when I try and type “…/home” the browser (happens across multiple browsers) appends a trailing slash so it becomes “…/home/” which is not a defined route and does not work.

I know there are work arounds on this, for example I could just embrace the trailing slash and move all my routes to work like this, but ideally I don’t want to do this and seems silly to make this change just because I cannot figure out what is going on.

In trying to diagnose the problem I spent a lot of time digging and researching. I think it could be related to a lot of potential things including an update to AWS Amplify, something to do with my SSL, any changes I may have made to my amplify configuration or my SAM template, something related to ngnix config, the way the routes are specified (this App.js and index.js file haven’t changed in a very long time and have been working previously).

Some of the main things I worked on include my template.yml (for SAM deployment) (snippet I think may be relevant):

  AmplifyRole:
    Type: "AWS::IAM::Role"
    Properties:
      AssumeRolePolicyDocument:
        Version: "2012-10-17"
        Statement:
          - Effect: Allow
            Principal:
              Service: "amplify.amazonaws.com"
            Action: "sts:AssumeRole"
      Policies:
        - PolicyName: "AmplifyAccessPolicy"
          PolicyDocument:
            Version: "2012-10-17"
            Statement:
              - Effect: Allow
                Action:
                  - "s3:*"
                Resource: "*"
              - Effect: Allow
                Action:
                  - "cloudfront:*"
                Resource: "*"
              - Effect: Allow
                Action:
                  - "lambda:*"
                Resource: "*"
              - Effect: Allow
                Action:
                  - "logs:*"
                Resource: "*"
      Description: "Role for AWS Amplify to access necessary AWS services"

  FrontendApp:
    Type: "AWS::Amplify::App"
    Properties:
      Name: !Ref "AWS::StackName"
      Repository: !Sub "https://github.com/${GitHubOrg}/${GitHubRepo}"
      AccessToken: !Ref GitHubAccessToken
      IAMServiceRole: !GetAtt AmplifyRole.Arn
      EnvironmentVariables:
        - Name: REACT_APP_BACKEND_URL
          Value: !Sub "https://${ClientAPIGateway}.execute-api.${AWS::Region}.amazonaws.com/Prod/graphql"
        - Name: REACT_APP_COGNITO_CLIENT_ID
          Value: !Ref CognitoUserPoolClient
        - Name: REACT_APP_COGNITO_DOMAIN
          Value: !Sub "${UserPoolDomain}.auth.${AWS::Region}.amazoncognito.com"
        - Name: REACT_APP_COGNITO_USERPOOL_ID
          Value: !Ref CognitoUserPool
        - Name: REACT_APP_REGION
          Value: !Ref "AWS::Region"
      BuildSpec: |-
        version: 1
        frontend:
          phases:
            preBuild:
              commands:
                - npm install
            build:
              commands:
                - npm run build
          artifacts:
            baseDirectory: build
            files:
              - '**/*'
          cache:
            paths:
              - node_modules/**/*

  MainBranch:
    Type: "AWS::Amplify::Branch"
    Properties:
      AppId: !GetAtt FrontendApp.AppId
      BranchName: !Ref BranchName
      EnableAutoBuild: true
      Stage: PRODUCTION

Outputs:
  FrontendUrl:
    Description: "URL for the frontend application"
    Value: !GetAtt FrontendApp.DefaultDomain

And the other file that I changed that may be relevant is my amplify.yml:

version: 1.0
frontend:
  phases:
    preBuild:
      commands:
        - cd frontend
        - npm install
    build:
      commands:
        - npm run build
  artifacts:
    baseDirectory: frontend/build
    files:
      - '**/*'
  cache:
    paths:
      - frontend/node_modules/**/*

Any help would be greatly appreciated as I really have no idea what is going on at all here.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật