You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Troubleshooting: Integrity Issues with Local Files
When using Bootstrap locally, you may encounter issues with the integrity attribute in <script> or <link> tags. This is because integrity checks the hash of the file to ensure its integrity. However, when you're using local files (i.e., files stored on your own server or filesystem), the integrity hash may not match, and the file may fail to load.
Solution:
To avoid this issue, simply remove the integrity attribute from the <script> or <link> tags when loading Bootstrap locally. The integrity attribute is primarily useful when loading files from a CDN, not for local development.
For example, instead of:
<scriptsrc="path/to/bootstrap.bundle.min.js" integrity="sha384-..." crossorigin="anonymous"></script>
👍 use
<scriptsrc="path/to/bootstrap.bundle.min.js"></script>
Hi, Thank you for raising this question! The failure of integrity verification for local files is indeed a common pain point, especially in development/offline scenarios. Based on the discussion, add a few suggestions: I notice that in the solution you simply remove the integrity attribute in or tags. However, this operation will inevitably affect security unless the local files are fully trusted. Therefore, I think it is necessary to first clarify the precautions for local use in the documentation, such as: "Using local files? Remove integrity or generate a new hash via openssl dgst sha384 basic FILE | openssl base64-A", and provide a script (such as gen integration.js) in the bootstrap/build directory to help developers generate the correct hash value for local files. Let me know if you'd like to submit this as a PR!
Uh oh!
There was an error while loading. Please reload this page.
Prerequisites
Describe the issue
Troubleshooting: Integrity Issues with Local Files
When using Bootstrap locally, you may encounter issues with the
integrity
attribute in<script>
or<link>
tags. This is becauseintegrity
checks the hash of the file to ensure its integrity. However, when you're using local files (i.e., files stored on your own server or filesystem), theintegrity
hash may not match, and the file may fail to load.Solution:
To avoid this issue, simply remove the
integrity
attribute from the<script>
or<link>
tags when loading Bootstrap locally. Theintegrity
attribute is primarily useful when loading files from a CDN, not for local development.For example, instead of:
Reduced test cases
<script src="path/to/bootstrap.bundle.min.js"></script>What operating system(s) are you seeing the problem on?
Windows
What browser(s) are you seeing the problem on?
No response
What version of Bootstrap are you using?
all
The text was updated successfully, but these errors were encountered: