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

500 error Next.js SSR #3319

Closed
5 tasks done
pruthviraj-developer opened this issue Feb 21, 2023 · 10 comments
Closed
5 tasks done

500 error Next.js SSR #3319

pruthviraj-developer opened this issue Feb 21, 2023 · 10 comments
Labels
archived This issue has been locked. bug Something isn't working compute investigating

Comments

@pruthviraj-developer
Copy link

pruthviraj-developer commented Feb 21, 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

d1l0h2bsjx0rcs

AWS Region

ap-south-1

Amplify Hosting feature

Build settings, Deployments, Frontend builds, Monorepo, SSR

Describe the bug

When loading the page https://release.d1l0h2bsjx0rcs.amplifyapp.com
getting 500 error, the build is getting generated successfully.

x-cache: error from Cloudfront

Expected behavior

the url https://release.d1l0h2bsjx0rcs.amplifyapp.com
should load successfully, but giving 500 error, in network says 500 error from cloudfront

Reproduction steps

https://release.d1l0h2bsjx0rcs.amplifyapp.com

Please load the above url

Build Settings

version: 1
applications:
  - frontend:
      phases:
        preBuild:
          commands:
            - 'yarn global add [email protected]'
            - 'lerna bootstrap'
            - 'lerna run --parallel  --scope "services" build'
            - 'lerna run --scope  "components" build'

        build:
          commands:
            - 'yarn run build'
      artifacts:
        baseDirectory: .next
        files:
          - '**/*'
      cache:
        paths:
          - .next/cache/**/*
    appRoot: web-apps/next-app

Log output

# Put your logs below this line
date,time,x-edge-location,sc-bytes,c-ip,cs-method,cs\(Host),cs-uri-stem,sc-status,cs\(Referer),cs\(User-Agent),cs-uri-query,cs\(Cookie),x-edge-result-type,x-edge-request-id,x-host-header,cs-protocol,cs-bytes,time-taken,x-forwarded-for,ssl-protocol,ssl-cipher,x-edge-response-result-type,cs-protocol-version,fle-status,fle-encrypted-fields,c-port,time-to-first-byte,x-edge-detailed-result-type,sc-content-type,sc-content-len,sc-range-start,sc-range-end
2023-02-20,06:02:10,BLR50-C3,211,106.51.83.195,GET,d1l0h2bsjx0rcs.cloudfront.net,/,500,https://ap-south-1.console.aws.amazon.com/,Mozilla/5.0%20\(Macintosh;%20Intel%20Mac%20OS%20X%2010_15_7)%20AppleWebKit/537.36%20\(KHTML%20like%20Gecko)%20Chrome/110.0.0.0%20Safari/537.36,-,-,Error,Xfuv6W_uJ2PIwtQZKR6qmpIt3G6pDAT7r9iYBtUiE9DQQBPmbOUxHg\=\=,release.d1l0h2bsjx0rcs.amplifyapp.com,https,734,0.866,-,TLSv1.3,TLS_AES_128_GCM_SHA256,Error,HTTP/2.0,-,-,53355,0.866,OriginError,-,0,-,-
2023-02-20,06:05:30,BLR50-C3,209,106.51.83.195,GET,d1l0h2bsjx0rcs.cloudfront.net,/,500,https://ap-south-1.console.aws.amazon.com/,Mozilla/5.0%20\(Macintosh;%20Intel%20Mac%20OS%20X%2010_15_7)%20AppleWebKit/537.36%20\(KHTML%20like%20Gecko)%20Chrome/110.0.0.0%20Safari/537.36,-,-,Error,MpnuAizUprc25kQxybpj4kpORVlansZvPiY2__P-m9GFjYz_rH9J9A\=\=,release.d1l0h2bsjx0rcs.amplifyapp.com,https,34,0.325,-,TLSv1.3,TLS_AES_128_GCM_SHA256,Error,HTTP/2.0,-,-,53355,0.325,OriginError,-,0,-,-
2023-02-20,06:05:32,BLR50-C3,214,106.51.83.195,GET,d1l0h2bsjx0rcs.cloudfront.net,/,500,https://ap-south-1.console.aws.amazon.com/,Mozilla/5.0%20\(Macintosh;%20Intel%20Mac%20OS%20X%2010_15_7)%20AppleWebKit/537.36%20\(KHTML%20like%20Gecko)%20Chrome/110.0.0.0%20Safari/537.36,-,-,Error,pQ8fRqLaSQI2tjjImfrE2lsQhiwqeX-8OCIAbO8g17pcOAP1pWOn4Q\=\=,release.d1l0h2bsjx0rcs.amplifyapp.com,https,43,0.002,-,TLSv1.3,TLS_AES_128_GCM_SHA256,Error,HTTP/2.0,-,-,53355,0.001,Error,-,0,-,-
2023-02-20,06:05:33,BLR50-C3,215,106.51.83.195,GET,d1l0h2bsjx0rcs.cloudfront.net,/,500,https://ap-south-1.console.aws.amazon.com/,Mozilla/5.0%20\(Macintosh;%20Intel%20Mac%20OS%20X%2010_15_7)%20AppleWebKit/537.36%20\(KHTML%20like%20Gecko)%20Chrome/110.0.0.0%20Safari/537.36,-,-,Error,d4WZOEye6MFiG7Qf0BJrGROoKb2TcATmhCBfR44UvS9lpID26wU1PQ\=\=,release.d1l0h2bsjx0rcs.amplifyapp.com,https,35,0.000,-,TLSv1.3,TLS_AES_128_GCM_SHA256,Error,HTTP/2.0,-,-,53355,0.000,Error,-,0,-,-
2023-02-20,07:34:36,BLR50-C3,211,106.51.83.195,GET,d1l0h2bsjx0rcs.cloudfront.net,/,500,https://ap-south-1.console.aws.amazon.com/,Mozilla/5.0%20\(Macintosh;%20Intel%20Mac%20OS%20X%2010_15_7)%20AppleWebKit/537.36%20\(KHTML%20like%20Gecko)%20Chrome/110.0.0.0%20Safari/537.36,-,-,Error,i4DZB3NjirYbuEt2oUe_YRwiwqnlrUpVVSQ41-LN_hVOL0FdoFz7nw\=\=,release.d1l0h2bsjx0rcs.amplifyapp.com,https,734,0.845,-,TLSv1.3,TLS_AES_128_GCM_SHA256,Error,HTTP/2.0,-,-,54549,0.845,OriginError,-,0,-,-
2023-02-20,07:25:26,BLR50-C3,211,106.51.83.195,GET,d1l0h2bsjx0rcs.cloudfront.net,/,500,https://ap-south-1.console.aws.amazon.com/,Mozilla/5.0%20\(iPhone;%20CPU%20iPhone%20OS%2013_2_3%20like%20Mac%20OS%20X)%20AppleWebKit/605.1.15%20\(KHTML%20like%20Gecko)%20Version/13.0.3%20Mobile/15E148%20Safari/604.1,-,-,Error,veeURVvpNr89rlOIOqUQcZeztGd-zLD6-mxciTSbe_62ZpIbnX0iSA\=\=,release.d1l0h2bsjx0rcs.amplifyapp.com,https,654,0.877,-,TLSv1.3,TLS_AES_128_GCM_SHA256,Error,HTTP/2.0,-,-,52270,0.877,OriginError,-,0,-,-
2023-02-20,08:39:07,BLR50-C3,212,106.51.83.195,GET,d1l0h2bsjx0rcs.cloudfront.net,/,500,https://ap-south-1.console.aws.amazon.com/,Mozilla/5.0%20\(Macintosh;%20Intel%20Mac%20OS%20X%2010_15_7)%20AppleWebKit/537.36%20\(KHTML%20like%20Gecko)%20Chrome/110.0.0.0%20Safari/537.36,-,-,Error,CB3wvf3HdqLuNVCnbwgPEXFTqaOQ4hbDLb8S34l8PDyCtLvbjVfLdQ\=\=,release.d1l0h2bsjx0rcs.amplifyapp.com,https,734,0.948,-,TLSv1.3,TLS_AES_128_GCM_SHA256,Error,HTTP/2.0,-,-,59670,0.948,OriginError,-,0,-,-
2023-02-20,09:10:02,BOM78-P2,211,103.110.48.106,GET,d1l0h2bsjx0rcs.cloudfront.net,/robots.txt,500,-,Mozilla/5.0%20\(Macintosh;%20Intel%20Mac%20OS%20X%2010_15_7)%20AppleWebKit/537.36%20\(KHTML%20like%20Gecko)%20Chrome/109.0.0.0%20Safari/537.36,-,-,Error,NPp2fqIpnH3nxdEvT2Pra-FqkfwdEkY0cpX3ISOcNcXeWCiffe6bEw\=\=,release.d1l0h2bsjx0rcs.amplifyapp.com,https,354,0.912,-,TLSv1.3,TLS_AES_128_GCM_SHA256,Error,HTTP/2.0,-,-,62712,0.912,OriginError,-,0,-,-
2023-02-20,09:10:02,BOM78-P2,211,103.110.48.106,GET,d1l0h2bsjx0rcs.cloudfront.net,/,500,-,Mozilla/5.0%20\(Macintosh;%20Intel%20Mac%20OS%20X%2010_15_7)%20AppleWebKit/537.36%20\(KHTML%20like%20Gecko)%20Chrome/109.0.0.0%20Safari/537.36,-,-,Error,MvH9uPp37MxPjofB-Wj7d_hYf8-WzmE5dJM-L0mKfJoE4P3WiBOBcg\=\=,release.d1l0h2bsjx0rcs.amplifyapp.com,https,670,0.870,-,TLSv1.3,TLS_AES_128_GCM_SHA256,Error,HTTP/2.0,-,-,62711,0.870,OriginError,-,0,-,-


Additional information

Screenshot 2023-02-21 at 9 04 08 AM

Screenshot 2023-02-20 at 2 53 13 PM

@pruthviraj-developer pruthviraj-developer added bug Something isn't working pending-triage labels Feb 21, 2023
@ghost
Copy link

ghost commented Feb 23, 2023

Hi @pruthviraj-developer 👋🏽 it looks like the requests are failing because there is a missing module:

Error: Cannot find module 'next/dist/server/next-server'

You can view these logs in your account by navigating to Monitoring > Hosting compute logs and then selecting the log group for the desired branch.

We are investigating this further and will provide an update once we have more information.

@pruthviraj-developer
Copy link
Author

Hi @hloriana Could you please update us, how to resolve the above issue, with more inputs.

@rajeshn95
Copy link

@hloriana @pruthviraj-developer Any update on the same, I am facing the same issue, and couldn't find any solution for it.

@pruthviraj-developer
Copy link
Author

Hi @hloriana Could you please update us, how to resolve the above issue, with more inputs.

@shivpratik
Copy link

shivpratik commented Apr 17, 2023

Hi, after successful deployment the static pages load fine and when try to load SSR pages I get 500 error with this error message on CloudWatch:

[Error: ENOENT: no such file or directory, open '/tmp/app/.next/server/edge-chunks/wasm_a7e702bc5ba9227243abda7977c8096f59478d3f.wasm'

NextJS Version: 13.3.0

@shivpratik
Copy link

Just to add to above issue, I deployed same repo on Vercel and it works perfectly fine. Why is Amplify throwing a 500 error for SSR pages?

@abepuentes
Copy link

@shivpratik I don't know if you found a workaround for your issue but for me the solution was to downgrade to NextJS Version 13.2.4, for me it was a bug in v.13.3.0 as stated here https://github.com/vercel/next.js/issues/48077#issuecomment-1504501461. I don't know what version @pruthviraj-developer is using. @hloriii maybe this could be useful to have in mind. NextJS 13.2.4 is working fine even using AppDir. there's a cold start of 7 seconds but that's a totally different issue.

@Jay2113
Copy link
Contributor

Jay2113 commented Mar 1, 2024

Hi everyone 👋 , based on the previous comments on the thread this issue seems to have been fixed after downgrading to Next v13.2.4. Also, over the past few months we have made significant improvements to how we bundle Next.js apps and we no longer rely on the standalone mode.

@Jay2113 Jay2113 closed this as completed Mar 1, 2024
Copy link

github-actions bot commented Mar 1, 2024

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

github-actions bot commented Mar 1, 2024

This issue has been automatically locked.

@github-actions github-actions bot added the archived This issue has been locked. label Mar 1, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Mar 1, 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. bug Something isn't working compute investigating
Projects
None yet
Development

No branches or pull requests

5 participants