Joshua Cappelli
Joshua Cappelli

Reputation: 1

Amplify error module-not-found even though previous deployments had no issue

I built a next.js SSR project and I have been trying to get host it on amplify. Previously there were no issues but all of a sudden I am getting module-not-found.

This is happenning for most of my components even though I didn't touch any components since my last deployment and when I try to redeploy older deployments that were running fine I get the same issue and the build fails. I thought the issue might have been changing my Amplify.yml file but when I reverted it I still kept getting the same issues. I also made sure that there are no export mismatches. Finally I also deleted my node_modules and .Next folders locally and tried npm ci and npm run build and once again there were no issues building locally. I am truly out of ideas.

below is the link to the github project: https://github.com/joshuacappelli/docsplusplus/tree/master

and here is the yaml file in case that might be the issue:

version: 1
frontend:
  phases:
    preBuild:
      commands:
        - npm ci
    build:
      commands:
        - echo "Creating .env file..."
        # Append only the environment variables you need server-side at runtime:
        - env | grep -E 'TURSO_CONNECTION_URL|TURSO_AUTH_TOKEN|NEXTAUTH_SECRET|NEXTAUTH_URL|OPENAI_API_KEY' >> .env

        - echo "Generated .env:"
        - cat .env

        - echo "Starting build..."
        - npm run build
  artifacts:
    baseDirectory: .next
    files:
      - '**/*'
  cache:
    paths:
      - .next/cache/**/*
      - .npm/**/*

Upvotes: 0

Views: 14

Answers (0)

Related Questions