Deploy to S3

AWS may have updated their default bucket configs, I needed to uncheck both Manage public bucket policies in the Public access settings tab of my bucket before I could access it from its static URL.

2 Likes

Got it. Thanks for letting us know.

I got a similar issue. I had to uncheck both options and when I hadnt I received a 403 error when trying to view the public website.

I see. Yeah we’ll update it soon.

Hi everyone,

I have an issue after upload image to s3. It show popup “TypeError: Cannot read property ‘length’ of undefined”
Also data didn’t store in DynamoDb and it was only image store in S3.

1 Like

Can you debug to see where that error message is coming from?

First, great tutorial, extremely helpful!

I’m having the same issue and don’t know how where to go from here. When I try to sync my build with S3 (aws s3 sync build/ s3://notes-app-client-recprotocol) I get the same error (fatal error: Could not connect to the endpoint URL: “https://notes-app-client-recprotocol.s3.eu-east-1.amazonaws.com/?list-type=2&prefix=&encoding-type=url”).
Any help would be greatly appreciated. Thanks in advance!!!

1 Like

Hmm that’s really weird. Can you check your S3 bucket settings and make sure that bucket is configured properly? You can try simple uploading directly through the console to see if that works.

With that method, the app is still publicly accessible through HTTP, isn’t that not secure? (E.g. http://notes-app-client.s3-website-us-east-1.amazonaws.com/ is still accessible)

Yeah I think somebody else had brought this up. I’m not sure what the solution here is. But in practice I’m this shouldn’t be as much of an issue. You could for example, set the CORS permissions to disallow API calls from your S3 bucket hosted app.

Edit: However, if you find a solution to force or disable the bucket hosted version, let me know.

Hey Guys, fantastic guide by the way.
I think I have all of this working beautifully (locally anyway), uploaded to s3 just fine etc

Strangely however when I connect or browse to index.html I am getting a ‘Sorry, Page not found.’
The login and signup pages work fine as does the Notes page once authenticated

Is this a potential routing issue for an unauthenticated user or something. Same happens in incognito or when trying safari (instead of chrome)

Any ideas of where to look would be appreciated!!

Thanks again for this fantastic walk through Ive really enjoyed following it!!

What does the error look like? Is it one that we are generating in our app?

“Sorry, page not found” so it’s a generated page … Only if trying to directly access “index.html” which we never setup in the routing… however since I setup the full domain hosting it seems to function without error and regardless of logged in or out… So no problem for now?

I guess this makes sense. If you navigate to pretty much any route that isn’t supported, you should get this error. So it is expected right?

I get this issue too BUT it does post my attachment into the bucket.
Idk where it’s being thrown. Did you solve this?

while doing npm run build for uploading the assets to S3 , i’m getting an error in app.js,

reating an optimized production build...
Failed to compile.

./src/App.js
Syntax error: C:/Users/saisw/notes-app-client/src/App.js: Unexpected token (53:17)

  51 |             <Nav activeKey={window.location.pathname}>
  52 |               {isAuthenticated ? (
> 53 |                 <>
     |                  ^
  54 |                   <LinkContainer to="/settings">
  55 |                     <Nav.Link>Settings</Nav.Link>
  56 |                   </LinkContainer>

Please help in solving this.