Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next.js build error: CloudFront input failed validation. Could not find next.js pages for "_next/image*" #3460

Closed
5 tasks done
dstout-current opened this issue May 4, 2023 · 5 comments
Labels
archived This issue has been locked. compute question Further information is requested

Comments

@dstout-current
Copy link

dstout-current commented May 4, 2023

Before opening, please confirm:

  • I have checked to see if my question is addressed in the FAQ.
  • I have searched for duplicate or closed issues.
  • I have read the guide for submitting bug reports.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.

App Id

d2gggx07fsqlf1

AWS Region

us-east-1

Amplify Hosting feature

Frontend builds

Describe the bug

Suddenly new builds are failing with this error in the Frontend build logs:

2023-05-04T18:43:15.534Z [INFO]: Starting SSR Build...
2023-05-04T18:45:09.634Z [ERROR]: Error: CloudFront input failed validation. Could not find next.js pages for "_next/image*"
                                  at NextjsComponent.validatePathPatterns (/root/./-patch.2/node_modules/@sls-next/-component/dist/component.js:97:19)
                                  at NextjsComponent.<anonymous> (/root/./-patch.2/node_modules/@sls-next/-component/dist/component.js:346:18)
                                  at Generator.next (<anonymous>)
                                  at fulfilled (/root/./-patch.2/node_modules/@sls-next/-component/dist/component.js:5:58)
                                  at processTicksAndRejections (node:internal/process/task_queues:96:5)
2023-05-04T18:45:09.636Z [ERROR]: �[G�[?25h�[G�[J
                                  74s › d2gggx07fsqlf1 › Error: CloudFront input failed validation. Could not find next.js pages for "_next/image*"

I reverted to an old commit and pushed that with no changes, and that new build also failed, even though it had originally succeeded.

Expected behavior

This error should not occur.

Reproduction steps

The version of next in package.json is "12.3.4"

The app in Amplify is still using the "Web dynamic" platform because "Web Compute" caused other errors.

Build Settings

amplify.yml uncustomized

Log output

2023-05-04T18:43:15.534Z [INFO]: Starting SSR Build...
2023-05-04T18:45:09.634Z [ERROR]: Error: CloudFront input failed validation. Could not find next.js pages for "_next/image*"
                                  at NextjsComponent.validatePathPatterns (/root/./-patch.2/node_modules/@sls-next/-component/dist/component.js:97:19)
                                  at NextjsComponent.<anonymous> (/root/./-patch.2/node_modules/@sls-next/-component/dist/component.js:346:18)
                                  at Generator.next (<anonymous>)
                                  at fulfilled (/root/./-patch.2/node_modules/@sls-next/-component/dist/component.js:5:58)
                                  at processTicksAndRejections (node:internal/process/task_queues:96:5)
2023-05-04T18:45:09.636Z [ERROR]: �[G�[?25h�[G�[J
                                  74s › d2gggx07fsqlf1 › Error: CloudFront input failed validation. Could not find next.js pages for "_next/image*"

Additional information

No response

@dstout-current dstout-current added bug Something isn't working pending-triage labels May 4, 2023
@ghost ghost added question Further information is requested compute and removed bug Something isn't working labels May 20, 2023
@ghost
Copy link

ghost commented May 25, 2023

Hi @dstout-current apologies for the delay here but it looks like your most recent builds has been successful. Were able to find the cause of the issue? Also, you mentioned migrating to WEB_COMPUTE resulted in some errors. What errors were you running into?

@ghost ghost added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed pending-triage labels May 25, 2023
@dstout-current
Copy link
Author

This particular error seemingly went away on its own the next day without any changes.

We had several issues with WEB_COMPUTE - calls to Next APIs stopped working (returned 503 cloudflare error) and dynamic pages (e.g. pages/[postid].js) weren't getting included in the build (would return 404).

Downgrading back to web dynamic fixed those issues

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label May 26, 2023
@arundna arundna assigned ghost Jun 8, 2023
@ghost ghost removed their assignment Jul 7, 2023
@Jay2113
Copy link
Contributor

Jay2113 commented Feb 14, 2024

I am going to close this thread as the original issue is resolved. Also, reviewed the latest build (67) on the main branch and it has deployed successfully.

@Jay2113 Jay2113 closed this as completed Feb 14, 2024
Copy link

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.

Copy link

This issue has been automatically locked.

@github-actions github-actions bot added the archived This issue has been locked. label Feb 14, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Feb 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived This issue has been locked. compute question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants