Hi, I see Axios is already installed in package.json, but why is it still causing axios is not defined
when we call axios on our script? isn't it already on plugins.bundle.js? Why select2 and sweetalert 2 can be used just using plugins.bundles.js? Thanks.
it's inside KTUtil.onDOMContentLoaded(function() {
});
But it's strange, why i can't find axios script on scripts.bundle.js although there is "axios": "^0.21.1",
inside package.json and I see it's already in node_modules folder either? am I missing something?
Oh, it seems we did not include it in the gulp config. Please try to add it in core/html/tools/gulp.config.js
and recompile the assets with gulp.
axios: {
scripts: [
"{$config.path.node_modules}/axios/dist/axios.min.js"
],
},
Hi,
May I know where you call Axios code ? On document ready event or right after page load ?
// On document ready
KTUtil.onDOMContentLoaded(function() {
// Axios code goes here
});