Dear support,
We are using Metronic Laravel Demo 8.0.37. We include repeater.js in global pages config
"plugins/custom/formrepeater/formrepeater.bundle.js", when we try to use in JS its giving "$(...).repeater is not a function" error. We also try to include it in plugin.js but the result is same. We also add
window.$ = require('jquery');
require('jquery.repeater');
in "resources/assets/core/plugins/custom/formrepeater/formrepeater.js"
But still result was same.
Please help us to resolve this issue.
Thanks
Dear support,
I also have the same problem (undefined repeater function error) when trying out the Advanced Form Repeater Demo with Laravel.
https://preview.keenthemes....formrepeater/advanced.html
(Did not include formrepeater.bundle.js in general/pages.php)
I managed to get the Basic Repeated Demo working by including 'plugins/custom/formrepeater/formrepeater.bundle.js', in pages.php
However, when doing the same in the Advanced Form Repeater, it breaks Select2 I have on the same blade page that was activated via data-control="select2"
Also, select2 that is called via form-repeater is also broken with this error
[Error] TypeError: $('[data-kt-repeater="select2"]').select2 is not a function. (In '$('[data-kt-repeater="select2"]').select2()', '$('[data-kt-repeater="select2"]').select2' is undefined)
I have also tried including form-repeater in plugins.js and ran npm run dev --demo6 as well
Any ideas how to fix it?
Thanks
Hi Margalla,
By default, Webpack adds a code wrapper for modular and this will cause the issue. For the below file, could you please try to change it as below? This will change the way of the build and the bundle file content.
resources/assets/core/plugins/custom/formrepeater/formrepeater.js
[
"node_modules/jquery.repeater/jquery.repeater.js"
]
formrepeater.js.json
Hi Margalla,
I had this same issue. Unfortunately, the only way I could get it to work was adding it directly in the base.blade.php
before the closing </body>
tag.
Line -
<script src="{{ asset("demo1/plugins/custom/formrepeater/formrepeater.bundle.js") }}"></script>
Hi Eric,
Thank you for your reply. I tried this solution also but still the result is same. I am getting same error.