My nuxt app is runing locallly without problems but when im trying to deploy the site to Netlify I got error like:
"Module not found: Error: Can't resolve '~/components/Navbar.vue' in '/opt/build/repo/layouts'"
I'm getting the following error:
ERROR in ./layouts/default.vue?vue&type=script&lang=js& (./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./layouts/default.vue?vue&type=script&lang=js&)
6:49:50 PM: Module not found: Error: Can't resolve '~/components/Navbar.vue' in '/opt/build/repo/layouts'
6:49:50 PM: @ ./layouts/default.vue?vue&type=script&lang=js& (./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./layouts/default.vue?vue&type=script&lang=js&) 8:0-45 11:12-18
6:49:50 PM: @ ./layouts/default.vue?vue&type=script&lang=js&
6:49:50 PM: @ ./layouts/default.vue
6:49:50 PM: @ ./.nuxt/App.js
6:49:50 PM: @ ./.nuxt/index.js
6:49:50 PM: @ ./.nuxt/client.js
6:49:50 PM: @ multi ./.nuxt/client.js
Please help, thanks in advance.
Make sure your file has the correct case for your import.
<script>
import Navbar from '~/components/Navbar.vue'
export default {
components: {
Navbar
}
}
</script>
Fails: components/NavBar.vue
Fails: components/Navbar.Vue
Correct: components/Navbar.vue
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With