@astrojs/vercel: Fix vercel analytics id not being provided #6751
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While testing out vercel analytics using the vercel adapter, I noticed there was an error in my console stating that
VERCEL_ANALYTICS_ID
has not been provided.After some research it looks as though it is looking for
PUBLIC_VERCEL_ANALYTICS_ID
but it is never provided. I believe this is likely the cause of the error.packages/integrations/vercel/src/analytics.ts
Running
vc pull
with the analytics enabled downloads an environment locally which containsVERCEL_ANALYTICS_ID
and notPUBLIC_VERCEL_ANALYTICS_ID
. The documentation also mentions that the environment variable is inlined at build time.https://vercel.com/docs/concepts/analytics/api#getting-started
Changes
Testing
Before fix: https://welcome-to-astro-7lrfynd8t-nblackburn.vercel.app/
After fix: https://welcome-to-astro-irzdnom89-nblackburn.vercel.app/
Docs
With this being, an internal change, I don't believe it requires any changes to the documentation.
/cc @withastro/maintainers-docs for feedback!