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

check for process.env.VERCEL_ANALYTICS_ID #630

Merged
merged 9 commits into from
Oct 26, 2022
Merged

check for process.env.VERCEL_ANALYTICS_ID #630

merged 9 commits into from
Oct 26, 2022

Conversation

jaasonw
Copy link
Contributor

@jaasonw jaasonw commented Oct 23, 2022

resolves 400 bad request error when local dev environment

image

@vercel
Copy link

vercel bot commented Oct 23, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
acm-csuf-site ✅ Ready (Inspect) Visit Preview Oct 26, 2022 at 8:51AM (UTC)

@EthanThatOneKid
Copy link
Owner

What issue is this PR resolving?

@jaasonw
Copy link
Contributor Author

jaasonw commented Oct 23, 2022

the issue where it shows a bunch of red text in my console when i npm run dev

@EthanThatOneKid
Copy link
Owner

The analytics ID is currently injected into the build at build time in svelte.config.js.

replace: [['$VERCEL_ANALYTICS_ID', process.env.VERCEL_ANALYTICS_ID]],

SvelteKit generates types for the available environment variables at build time. I think it might be possible to extend the functionality described here: https://kit.svelte.dev/docs/modules#$env-dynamic-public.

EthanThatOneKid added a commit that referenced this pull request Oct 26, 2022
- Refactored analytics library: factored out `send.ts` into `vitals.ts`.

Addresses <#630 (comment)>.

Thanks @jaasonw for kicking off this PR :)
@vercel vercel bot temporarily deployed to Preview October 26, 2022 06:07 Inactive
- Refactored analytics library: factored out `send.ts` into `vitals.ts`.
- Added env variables to pass `website_check.yaml` workflow.

Addresses <#630 (comment)>.

Thanks @jaasonw for kicking off this PR :)
@vercel vercel bot temporarily deployed to Preview October 26, 2022 07:08 Inactive
- Refactored analytics library: factored out `send.ts` into `vitals.ts`.
- Added env variables to pass `website_check.yaml` workflow.

Addresses <#630 (comment)>.

Thanks @jaasonw for kicking off this PR :)
@vercel vercel bot temporarily deployed to Preview October 26, 2022 07:12 Inactive
@vercel vercel bot temporarily deployed to Preview October 26, 2022 07:14 Inactive
@vercel vercel bot temporarily deployed to Preview October 26, 2022 07:18 Inactive
@vercel vercel bot temporarily deployed to Preview October 26, 2022 07:26 Inactive
@vercel vercel bot temporarily deployed to Preview October 26, 2022 07:39 Inactive
Copy link
Owner

@EthanThatOneKid EthanThatOneKid left a comment

Choose a reason for hiding this comment

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

After some light reorganization, this PR lgtm!

@vercel vercel bot temporarily deployed to Preview October 26, 2022 08:51 Inactive
@jaasonw
Copy link
Contributor Author

jaasonw commented Oct 26, 2022

oh

@jaasonw jaasonw merged commit ede06e6 into main Oct 26, 2022
@jaasonw jaasonw deleted the check_anal_id branch October 26, 2022 09:09
@EthanThatOneKid EthanThatOneKid restored the check_anal_id branch October 31, 2022 04:03
@EthanThatOneKid EthanThatOneKid deleted the check_anal_id branch October 31, 2022 04:12
EthanThatOneKid added a commit that referenced this pull request Oct 31, 2022
> PR #629 introduced a regression by ignoring the changes made in #630. This PR reintroduces the changes from #630.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

console displays 400 bad requests on local development environment with no vercel analytic ksy
2 participants