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.

404 not found on accessing root (index.html)

See original GitHub issue

Describe the bug Hey guys,

I’m gonna be honest with you, I just started playing with AWS for 2 months. Still very new to everything, so probably its just a dumb mistake (sorry!).

Came across this repo and tried to deploy 1 today. Really love the work!

I’m not sure if this is a bug that’s been fixed, but I think I choose a stable version of your version (not the alpha one)

# serverless.yml
myApp:
  component: "@sls-next/serverless-component@1.15.1"

To Reproduce All I did was serverless deploy, and boom when I go to my cloudfront link, it just shows 404 page not found.

Checked the lambda for routing and it looks fine, I’m just creating a simple few pages app. But the static-pages/index.html is there in s3 but doesn’t seem to route there.

api/api1.js works though. So i’m not sure what’s happening with my pages. Any help would be appreciated

Cheers guys

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

7reactions
danielcondemarincommented, Aug 1, 2020

This should be fixed now in @sls-next/serverless-component@1.16.0 🎉

3reactions
robertwt7commented, Jul 29, 2020

Ah i got it now

After downgrading to next v9.4.4 I realise that the index.html page is moved to public/index.html instead of static-pages/index.html

Thus this line won’t work. Still doesn’t answer why root url doesn’t get logged though. Just went pass through it straightaway

    if (isHTMLPage || isPublicFile) {
        s3Origin.path = isHTMLPage ? "/static-pages" : "/public";
        addS3HostHeader(request, normalisedS3DomainName);
        if (isHTMLPage) {
            request.uri = `${uri}.html`;
        }
        return request;
    }
Read more comments on GitHub >

github_iconTop Results From Across the Web

Error 404 not found - What does it mean & how to fix it!
Open the .htaccess file (or create one if needed) in the root directory, enter this in 'ErrorDocument 404 /404.html' and save the change....
Read more >
HTTP-404 When Viewing WebCenter Portal Framework ...
3 environment, the test URL is not working and shows a HTTP 404 error. For example: http://<HOSTNAME>:<PORT>/MyApp-context-root/index.html http ...
Read more >
Root html (/index.html) can't be fetched. Returns 404
Everything works fine except that if anything on the html pages are redirecting to "index.html" gets me a page not found ("GET /index.html...
Read more >
Home page 404 error index.html
404 page not found error. When previewing the site the home page always loads index.html. I have searched the forums and tried reloading...
Read more >
Get 404 error when trying to access index.html and contact. ...
Did you change the html files that are in your root directory, or the files that are in the template directory? If you...
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