vercel / analytics

Privacy-friendly, real-time traffic insights
https://vercel.com/analytics
Mozilla Public License 2.0
423 stars 26 forks source link

Refused to execute script #4

Closed alex289 closed 1 year ago

alex289 commented 1 year ago

I just added this to my site but when I visit it this error gets logged: Refused to execute script from 'https://alexanderkonietzko-84q9dz1ke-alex289.vercel.app/va/script.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

Does this happen because I have X-Content-Type-Options: nosniff enabled?

Here is my repo for more information

chriswdmr commented 1 year ago

Thanks for reaching out! It seems like you haven't redeployed after you enabled the feature on the Vercel dashboard.

Please make sure you:

  1. Enable the feature on the Vercel dashboard
  2. Install the package based on the instructions
  3. Redeploy your app

Once you redeployed after enabling the feature, the route /va/script.js will become available on your deployment

alex289 commented 1 year ago

I redeployed but still the same error

ghoshnirmalya commented 1 year ago

@chriswdmr I'm getting the same error even after deployment. I'm using the following versions:

"@vercel/analytics": "0.1.3",
"next": "12.1.4",

Can you please re-open this issue?

alex289 commented 1 year ago

@chriswdmr I'm getting the same error even after deployment. I'm using the following versions:

"@vercel/analytics": "0.1.3",
"next": "12.1.4",

Can you please re-open this issue?

I still have this error too but I don’t have the permission to reopen it sorry

tobiaslins commented 1 year ago

@ghoshnirmalya can you please share a deployment URL with us? When was your last redeployment?

@alex289 I see your production deployment already exposes https://alexanderkonietzko.vercel.app/va/script.js for you, so resolved?

alex289 commented 1 year ago

I did not check if it was resolved after this but if it is I can say it's resolved for me

ghoshnirmalya commented 1 year ago

@tobiaslins You can check out https://rapidapi.com/guides/categories/graphql. The last deployment was 4 days ago.

tobiaslins commented 1 year ago

@ghoshnirmalya I can't see the deployment url (vercel.sh) easily because the /guides thing is proxied right? Can you just try redeploying and see if it works? If not please send me the deployment url (ending with .vercel.sh) Thanks :)

tobiaslins commented 1 year ago

@ghoshnirmalya I just found out that you're proxying the Next.js app and the root is not rapidapi.com but rapidapi.com/guides right?

ghoshnirmalya commented 1 year ago

@tobiaslins That is correct.

tobiaslins commented 1 year ago

@ghoshnirmalya Can you tell us more on your proxy setup? It seems like (https://rapidapi.com/guides/va/script.js) is also not available. Could you please send us a deployment url (ending with .vercel.sh)? Thanks!

ghoshnirmalya commented 1 year ago

@tobiaslins You can use https://devrel-stack-guides.vercel.app/guides.