Suddenly on one-page JavaScript was breaking. After extensive checking and if found that on the page where js was breaking, the type attribute
is not added for js files. Example below
<script src="/assets/vendor/js/bootstrap.js"></script>
<script src="/assets/vendor/js/sidenav.js"></script>
But other pages do have the type attribute
<script src="/assets/vendor/js/bootstrap.js" type="151266feb6702223b099e35a-text/javascript"></script>
<script src="/assets/vendor/js/sidenav.js" type="151266feb6702223b099e35a-text/javascript"></script>
Later I also noticed that the type attribute
is not added if server send more json
code to the page. If I limit, so less json
code is sent to hte page it all works, and the type attribute
is added, but if page receives more json
it breaks and the type attr
is not added, in addition I see these errors in console:
rocket-loader.min.js:1 Uncaught TypeError: I is not a constructor
at l (rocket-loader.min.js:1)
at t.simulateStateBeforeDeferScriptsActivation (rocket-loader.min.js:1)
at P (rocket-loader.min.js:1)
at Object.callback (rocket-loader.min.js:1)
at t.run (rocket-loader.min.js:1)
at rocket-loader.min.js:1
at HTMLScriptElement.<anonymous> (rocket-loader.min.js:1)
Any thoughts why it is happening? The page with error is accessible only for logged in users, therefore I cannot share the link now.