Closed (fixed)
Project:
Bootstrap
Version:
5.0.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Sep 2024 at 22:22 UTC
Updated:
27 Sep 2024 at 13:44 UTC
Jump to comment: Most recent
I get this error when the theme is loaded after a cache clear. The file does not exist for sure.
Warning: file_get_contents(themes/contrib/bootstrap/js/bootstrap.js): Failed to open stream: No such file or directory in _locale_parse_js_file() (line 1097 of core\modules\locale\locale.module)
Comments
Comment #2
flyke commentedTemporary fix, using CDN instead of including the necessary bootstrap file in the theme itself:
edit bootstrap.libraries.yml and add a new 'bootstrap-js' library which for now uses a CDN url for the necessary js file.
Then edit the global-styling library and add bootstrap/bootstrap-js as a dependency:
Comment #3
marc.bauWell, my websites should not depend on external servers. All files must come from my machine.
Comment #4
flyke commentedI agree, its up to the maintainers of this module to include the necessary files.
This is just a workaround.
Comment #5
marc.bauthemes/contrib/bootstrap/js/bootstrap.jsis a file that exist in B3, but dot not in B5. But the references to the file still exists in code. That is the reason why this error bubbles up. Only the reference need to be removed I think.Comment #6
flyke commentedI think the file is needed, I think without it JS functions like closing a status message by clicking on the X will not work, or info popups (popper.js stuff) will also not work without it I think. But feel free to test by removing it from the libraries.yml file, clear your cache, and try to close any status message. Like when clearing caches from the frontend, try to close the all caches have been cleared message.
Comment #7
hatuhay commentedThe correct js file to be loaded is base.js
Comment #9
hatuhay commented