If I have 2 JavaScript files located in the 'resources/assets/js' directory, named 'app.js' and 'ext_app.js', what could be the issue?
Within 'ext_app.js' file, there is a function defined like this:
function testFunction() {
// function code
}
And in 'app.js', the following code is present:
require('./bootstrap');
require('./ext_app.js');
const app = new Vue({
// other stuff
mounted: function() {
// Call my test function from ext_app.js
testFunction();
}
});
After running 'npm run dev' and inspecting 'public/js/app.js', it seems like the 'ext_app.js' code has been included correctly. However, when running the application on Chrome, an error is encountered:
[Vue warn]: Error in mounted hook: "ReferenceError: testFunction is not defined"
What step may have been overlooked in this scenario?