javascriptjquerynode.jsbootstrap-4

Bootstrap popper.js Failed to find a valid digest in the 'integrity' attribute for resource


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


Solution

  • 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>