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

Refusal for Execution #883

Open
Quatromic opened this issue Feb 9, 2024 · 4 comments
Open

Refusal for Execution #883

Quatromic opened this issue Feb 9, 2024 · 4 comments

Comments

@Quatromic
Copy link

As I paste in the script page to use the library in my html file.An error pops up that says exactly this:
' Refused to execute http://127.0.0.1:5500/anime.min.js as script because "X-Content-Type-Options: nosniff" was given and its Content-Type is not a script MIME type. '

This error simply pops up as soon as you paste in the script link tag towards the library
I honestly expected It to work but even the (anime) call simply failed to work

Here is a screenshot of exactly what I'm seeing on my side
screenshot 2024-02-09 at 22 48 22

I'm currently using a MacBook laptop and I use Safari as let's say my default browser Version 17.3.1

If I'm the one wrong on my side. A simple explanation to the resolution of my problem would be much appreciated.

Regards,
Quatromic

@different55
Copy link
Sponsor

different55 commented Feb 12, 2024

You need to set the proper Content-Type headers for whatever software is serving up your files on port 5500. It's not an anime.js issue, if you try even a super basic script you'll probably find you can't get any JS running. It seems like you might be using VSCode live server, I'd check out their documentation or any FAQs for answers.

@Quatromic
Copy link
Author

You need to set the proper Content-Type headers for whatever software is serving up your files on port 5500. It's not an anime.js issue, if you try even a super basic script you'll probably find you can't get any JS running. It seems like you might be using VSCode live server, I'd check out their documentation or any FAQs for answers.

How would I do that? and yes I am using live server in VS Code.

@different55
Copy link
Sponsor

I really can't say for certain, I can only tell you that that's the direction your answer's in. Find out why Live Server is serving your script files as something other than text/javascript, and you'll have found out why it's not working.

Or ignore the problem and link to a CDN-hosted copy of anime.js. Won't have any issue with MIME types that way.

@Quatromic
Copy link
Author

I really can't say for certain, I can only tell you that that's the direction your answer's in. Find out why Live Server is serving your script files as something other than text/javascript, and you'll have found out why it's not working.

Or ignore the problem and link to a CDN-hosted copy of anime.js. Won't have any issue with MIME types that way.

Alright, thanks for your help @different55 ,I'll inform when I get the problem's solution.

Cheers,
Quatromic

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

2 participants