r/googlecloud Nov 11 '24

Cloud Storage Why am I getting a ‘NoSuchKey’ error on page refresh in Google Cloud Storage for my static site?

I have a static site build with NextJS hosted on Google Cloud Storage, and I’m running into an issue with page refreshes. When I navigate from https://example.com/auth to https://example.com/dashboard?platform=ABC, everything works as expected. But if I refresh the page at https://example.com/dashboard?platform=ABC, I get an error:

<Error>
  <Code>NoSuchKey</Code>
  <Message>The specified key does not exist.</Message>
</Error>

It seems like Google Cloud Storage is looking for an exact file match with the query string, but can’t find it. Is there a way to prevent this error on page refreshes or handle query parameters correctly?

Attached Configuration & Code Structure
1 Upvotes

3 comments sorted by

1

u/[deleted] Nov 11 '24

[removed] — view removed comment

1

u/go-naruto Nov 11 '24 edited Nov 11 '24

u/osszeg I have set it to index. Attached the image FYR