ReferenceError: axios is not defined
I am having the following error:
ReferenceError: axios is not defined
I am running the demo1 from Metronic v8.2.3.
I've tried call axios from browser console in the file demo1/authentication/layouts/creative/sign-in.html and have the same error.
In the package.json the package is there
"axios": "^1.6.5", And in my gulp.conf.js
axios: {
scripts: [
"$config.path.node_modules}/axios/dist/axios.min.js"
],
}, I tried to move from "optional" to "mandatory" and the error persist.
Replies (1)
Hi
axios is already included by default in the plugins.bundle.js file, so you don't need to manually include it in your project. The error you're encountering, "ReferenceError: axios is not defined," might be due to how you're trying to use axios or where you're including your custom JavaScript files.
Make sure that you're using axios correctly in your JavaScript files and that you're including your custom scripts after plugins.bundle.js to ensure that axios is available when your scripts are executed. If you're still encountering issues, double-check your file paths and how you're including your scripts in your HTML files.