0

hello everyone for a realtime laravel application i want to use axios . in app.js file in resources directory I required axios file here is all app.js file codes :

require('./bootstrap');
window._ = require('lodash');
window.axios = require('axios');
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';

the problem is when I want to use axios in frontend it errors that axios is not defined so what the problem ? can someone help me please ...

2

1 Answer 1

0

i realized that in my layout template I forgot delete defer from app.js script and it cause in entire project Axios and Echo libraries not be recognized so after deleted "defer" from script tag it works like a charm

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.