Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(vercel): support custom baseURL #2464

Merged
merged 1 commit into from
May 23, 2024
Merged

fix(vercel): support custom baseURL #2464

merged 1 commit into from
May 23, 2024

Conversation

danielroe
Copy link
Member

@danielroe danielroe commented May 23, 2024

πŸ”— Linked issue

resolves nuxt/nuxt#26886
resolves nuxt/nuxt#21780
resolves #1348

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

It's possible to deploy sites to Vercel with a custom baseURL and the renderer will correctly handle 404 on / and correct responses from /<baseURL>/ but the public assets aren't configured to respect the baseURL.

Published minimal reproduction & patch to https://github.com/danielroe/nuxt-3-vercel-baseurl-test - you can see deployed at https://nuxt-3-vercel-baseurl-test-tan.vercel.app/subdir.

You can confirm that correct headers are added to a request like:

http --headers https://nuxt-3-vercel-baseurl-test-tan.vercel.app/subdir/_nuxt/C7CLbNSw.js
> HTTP/1.1 200 OK
> Access-Control-Allow-Origin: *
> Age: 88
> Cache-Control: public,max-age=31536000,immutable
> Connection: keep-alive
> Content-Disposition: inline; filename="C7CLbNSw.js"
> Content-Encoding: gzip
> Content-Type: application/javascript; charset=utf-8
> Date: Thu, 23 May 2024 16:37:55 GMT
> Etag: W/"c44aff3c70a5f49fad126ee0c615c297"

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@danielroe danielroe added bug Something isn't working preset:vercel labels May 23, 2024
@danielroe danielroe requested a review from pi0 May 23, 2024 16:40
@danielroe danielroe self-assigned this May 23, 2024
Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for carefully testing it ❀️

@pi0 pi0 merged commit 61f2079 into main May 23, 2024
5 checks passed
@pi0 pi0 deleted the fix/vercel-base-url branch May 23, 2024 17:13
@pi0 pi0 mentioned this pull request Jun 13, 2024
@pi0 pi0 mentioned this pull request Jun 27, 2024
pi0 pushed a commit that referenced this pull request Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working preset:vercel
Projects
None yet
2 participants