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

HTTP 404 error for /_vercel/insights/script.js #83

Closed
michaelcais opened this issue May 21, 2023 · 3 comments
Closed

HTTP 404 error for /_vercel/insights/script.js #83

michaelcais opened this issue May 21, 2023 · 3 comments

Comments

@michaelcais
Copy link

michaelcais commented May 21, 2023

I added the Vercel Web Analytics to my project. I enabled the feature on Vercel project dashboard, installed the package and initialized the package inside my project but I'm getting an HTTP 404 error for /_vercel/insights/script.js. My site is proxied through Cloudflare. Is there any special configuration needed other than what was documented here?

I have automatic deployments to Vercel from Github commits. I have also added in my Content Security Policy the domains;

I saw a similar issue but there wasn't any resolution provided. I can provide my site URL privately if needed.

image
@michaelcais
Copy link
Author

michaelcais commented May 21, 2023

I found another closed issue that refers to deployment. I went back to the Vercel Dashboard and redeployed manually the project and this seemed to fix the issue and Web Analytics is now getting data. Is there an issue with automatic deployment from GitHub that I have to manually initiate a redeployment from the dashboard?

Steps I did are the following;

  1. Enabled Web Analytics on Vercel Dashboard
  2. Installed the npm package to my project
  3. Added the Analytics Component to the _app.js document
  4. Committed and pushed to upstream
  5. Project production branch successfully deployed to Vercel
  6. Vercel Dashboard toast message reported not getting any data
  7. Website showed error on the console log, missing _vercel script folder
  8. Went to Vercel Dashboard Deployments and redeployed most recent deployment
  9. Vercel dashboard now shows analytic data

@tobiaslins
Copy link
Collaborator

Hey @michaelcais!

The automatic deployment works here as well. The only thing that is important is the order. Web Analytics needs to be enabled before the deployment is started.

Glad that you resolved it!

@RylanBot
Copy link

RylanBot commented Sep 30, 2023

Hi, I enabled Web Analytics before the deployment started, but it still fails to work.

It's been spinning, showing that it's loading.

I use Vue2 to import this dependency, and it seems to work locally.

Hey @michaelcais!

The automatic deployment works here as well. The only thing that is important is the order. Web Analytics needs to be enabled before the deployment is started.

Glad that you resolved it!

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

No branches or pull requests

3 participants