question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

index gives 404 @3.1.0-alpha.6

See original GitHub issue

Describe the bug

The index page gives 404

response headers:

age: 3
cache-control: public, max-age=0, s-maxage=2678400, must-revalidate
content-encoding: gzip
content-type: text/html
date: Tue, 22 Jun 2021 12:08:02 GMT
etag: W/"c9bf02fb02561a8f39002ccba9ae135b"
last-modified: Tue, 22 Jun 2021 12:04:04 GMT
server: AmazonS3
vary: Accept-Encoding
via: 1.1 81d299a580e85cd7d4af1e1123f3282a.cloudfront.net (CloudFront)
x-amz-cf-id: RauBQ_qL2RxhP0SGEsX4RhAuOC0WiBqA-jE_Qs5TLQly1P0wMJQa0Q==
x-amz-cf-pop: GRU3-C2
x-cache: Error from cloudfront

Actual behavior

After deploy, the index page gives 404

Expected behavior

Status code must be 20x

Steps to reproduce

1 - create a new next app 2 - create a simple serverless.yml 3 - deploy to aws

repo: https://github.com/lalvesoliveira/teste-aws my application: https://da8ewscicjuzd.cloudfront.net/

Versions

Checklist

  • You have reviewed the README and FAQs, which answers several common questions.
  • Please first try using the most recent latest or alpha @sls-next/serverless-component release version, which may have already fixed your issue or implemented the feature you are trying to use. Note that the old serverless-next.js component and the serverless-next.js plugin are deprecated and no longer maintained.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

3reactions
dphangcommented, Jun 22, 2021

Found the problem… the origin response handler tries to reverse the s3 page -> original URL. So index.html became /index but actually it should be / as /index isn’t found as any route, so it sets to 404 page.

I thought we had sufficient tests for this but somehow the e2e tests stopped testing index page with SSG/HTML page. Will add back tests for it and fix

0reactions
nmclearcommented, Jul 9, 2021

Ah nice catch, thanks @dphang

Read more comments on GitHub >

github_iconTop Results From Across the Web

ASP.NET Core 3.1 areas return 404 on some methods but ...
c# - ASP.NET Core 3.1 areas return 404 on some methods but not on the Index one - Stack Overflow. Stack Overflow for...
Read more >
index 404 not found · Issue #861 · serverless-nextjs ...
On website load/reload, App renders the complete layout with nav bar and footer but index page ('/') is not found. When clicking in...
Read more >
Net 6 API - 404 Not found
NET 6 and locally, I can see all controllers working and using them through swagger. ... run DEBUG, copy swagger url /swagger/index.html.
Read more >
PEP 440 – Version Identification and Dependency Specification
“Index servers” are active distribution registries which publish version and ... Pre-releases for a given release are ordered first by phase (alpha, beta, ......
Read more >
Firebase JavaScript SDK Release Notes - Google
Updated "missing index" error message to include the link to create the composite ... FCM now provides delivery data export to BigQuery as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found