Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Charlie Prator
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Charlie Prator
Front End Web Development Techdegree Graduate 19,854 Points

Got the following console error trying to follow Aisha's video: "Failed to find a valid digest in the 'integrity' att...

Full console error reads:

"Failed to find a valid digest in the 'integrity' attribute for resource 'https://code.jquery.com/jquery-3.2.1.min.js' with computed SHA-256 integrity 'hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4='. The resource has been blocked."

StackOverflow says it's a problem with the integrity attribute of the jQuery <script>, but this discussion is flying over my head.

So, I made it blank, and it worked fine.

I'm posting this for others to see, but I wouldn't mind if someone could explain what the integrity attribute does and why jQuery wasn't loading.

2 Answers

Steven Parker
Steven Parker
229,744 Points

The integrity attribute is a content verification.

It confirms that the content being loaded is the same as what you intended. The fact that it is blocking the load would indicate that it does not match. Did you perhaps change the version but keep the same integrity value?

Removing the attribute eliminates the verification completely, so the content will always be loaded.

Charlie Prator
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Charlie Prator
Front End Web Development Techdegree Graduate 19,854 Points

You know, I actually don't remember how it ended up. I did change the version to the most recent one, but then I made the value empty.

Thanks for the quick explanation, Steven!