0

I am facing an issue with my Nuxt.js application, which is deployed on an S3 bucket. Despite the configuration, only the index.html page is being generated, and any route other than the root (/) returns a 404 error. This is affecting the site's functionality and SEO indexing.

Here is some information:

Nuxt Configuration: My nuxt.config.js is configured to generate static files with target: static and ssr: false.

S3 Bucket Configuration: The bucket is set up with static website hosting enabled, using index.html as both the index and error document. This config allow the page to be rendered perfectly for every route, but I still have a 404 error.

Precisely, when someone request any route other than the root like /test, the S3 bucket will return a 404 error (because no file found at /test/index.html) and redirect the user to the index.html, and the index.html file will render the page as if there were no error because nuxt will route them to /test.

It's not a problem functionally speaking, but it becomes a problem for indexing as Google receives 404 errors.

I've tried to modify Nuxt's config in different ways based on this Nuxt documentation.

1 Answer 1

0

Finally found a solution: Simply had to regenerate the yarn.lock file. I don't get why it worked, but it worked.

Not the answer you're looking for? Browse other questions tagged or ask your own question.