Lately, I've been encountering an error during webpack build that is causing some issues.
ERROR There were 3 errors encountered while compiling
The following relative modules could not be found:
* ./components/component1.vue in ./resources/assets/js/lmi/app.js
* ./components/component2.vue in ./resources/assets/js/lmi/app.js
* ./components/component3.vue in ./resources/assets/js/lmi/app.js
app.js
document.addEventListener("DOMContentLoaded", function() {
const Vue = require('vue');
// Registering all the parent components
Vue.component('component1', require('./components/component1.vue'));
Vue.component('component2', require('./components/component2.vue'));
Vue.component('component3', require('./components/component3.vue'));
// Initializing the root vue instance.
const app = new Vue({
el: '#app'
});
});
Steps taken so far:
This used to work fine before and I have even gone through older branches and re-ran
npm install
again.I tried specifying the absolute path in the require statements, but then I get a different error message instead:
ERROR There were 3 errors encountered at 12:14:37 PM
These dependencies were missing:
/resources/assets/js/lmi/components/hourly-wage.vue in ./resources/assets/js/lmi/app.js
/resources/assets/js/lmi/components/search.vue in ./resources/assets/js/lmi/app.js
/resources/assets/js/lmi/components/hiring-demand.vue in ./resources/assets/js/lmi/app.js
To resolve these, you can run: npm install --save /resources/assets/js/lmi/components/hourly-wage.vue /resources/assets/js/lmi/components/search.vue /resources/assets/js/lmi/components/hiring-demand.vue
I'm quite puzzled by this situation. Any guidance on what might be causing this would be greatly appreciated.