5

Using cdn from bootstrap pages causing this error on all my bootstrap pages

<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>

Failed to find a valid digest in the 'integrity' attribute for resource 'https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js' with computed SHA-256 integrity 'f/3u5OOj9c7fUgL5NEWK2U65jTKCMSzCWp6P+l+eKGI='. The resource has been blocked.

if you are using bootstrap in any of your projects this error might also be visible to you

Sanjay
  • 838
  • 1
  • 14
  • 21

3 Answers3

1

That appears to be an out dated include snippet for popper.

Currently, the latest Bootstrap documentation shows this to be their popper snippet

<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js" 
    integrity="sha384-cs/chFZiN24E4KMATLdqdvsezGxaGsi4hLGOzlXwp5UZB1LY//20VyM2taTB4QvJ" 
    crossorigin="anonymous"></script>

If you wanted to include the version you have currently listed, you could drop the integrity attribute altogether like so (you can read about what that attribute does here What are the integrity and crossorigin attributes?)

<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"
    crossorigin="anonymous"></script>

It looks like it also may be the case that your browser doesn't support the sha384 hash as a valid digest, so you could also update the digest to one your browser will support like this

<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"
    integrity="sha256-f/3u5OOj9c7fUgL5NEWK2U65jTKCMSzCWp6P+l+eKGI="
    crossorigin="anonymous"></script>
Brian Leishman
  • 8,155
  • 11
  • 57
  • 93
  • Did you try the second and last approaches? If so, what error messages are you getting? – Brian Leishman Nov 11 '18 at 04:02
  • Adpt script error [ ti.4070|Cannot read property 'dba' of undefined ] ( TypeError: Cannot read property 'dba' of undefined|z (https://e2b8u3v8.map2.ssl.hwcdn.net/s/965db08d-7bda-47bd-a903-cd2016de2f25.js?cb=19273:3:2757)|B (https://e2b8u3v8.map2.ssl.hwcdn.net/s/965db08d-7bda-47bd-a903-cd2016de2f25.js?cb=19273:3:3605)|https://e2b8u3v8.map2.ssl.hwcdn.net/s/965db08d-7bda-47bd-a903-cd2016de2f25.js?cb=19273:3:8451|https://e2b8u3v8.map2.ssl.hwcdn.net/s/965db08d-7bda-47bd-a903-cd2016de2f25.js?cb=19273:3:33992 ) i don't understant why this is coming with 2nd & 3rd approach – Sanjay Nov 11 '18 at 04:03
  • It is there for security reasons. It is called SRI. Link to documentation https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity. Although we had an issue with not working hashing algorithm sha384 for other OS than macOS. The browser seems to don't have any effect on that – Václav Stummer Oct 13 '22 at 11:21
-2

I had a similar issue and just ended up removing the integrity tag to every script and link tag.

It solved my problem. I don't think there's much we can do on our end here if we are using CDN service.

Dev Rathi
  • 703
  • 6
  • 8
-2

Just remove the integrity taggs. Helpt me and it does not change anything on your site.