I have a project on Vue.js with Typescript and when I run dev server (prod build too) it returns error in console:
ERROR Failed to compile with 1 errors
This relative module was not found:*./app.vue in ./src/main.ts
I alredy tried to checkout previous project commits, update global and local packages, clone and build project on other machines, delete and reinstall packages, delete package-lock.json, create new project via vue cli and add project files on new configuration - and nothing was changed. Same error. Very strange for me.
Here is my main.ts
import Vue from 'vue'; import App from './app.vue'; import router from './router'; import store from './store';  Vue.config.productionTip = false;  new Vue({   router,   store,   render: (h) => h(App) }).$mount('#app'); And here App.vue
<template>   <div id="app" class="container-fluid">     <header-component></header-component>     <main id="content" class="content row">       <transition name="fade">         <router-view/>       </transition>     </main>     <footer-component></footer-component>   </div> </template>  <script lang="ts"> import { Component, Vue } from 'vue-property-decorator'; import HeaderComponent from './components/header/header.component'; import FooterComponent from './components/footer/footer.component';  @Component({   components: {     HeaderComponent,     FooterComponent   } }) export default class App extends Vue {} </script>  <style lang="scss"> @import "../node_modules/bootstrap/dist/css/bootstrap.min.css"; @import "../node_modules/font-awesome/css/font-awesome.min.css"; @import "../node_modules/vue2-animate/dist/vue2-animate.min.css"; @import "./styles/main.scss"; </style> Thanks in advance for help.
It was a spelling error. I change
import App from './app.vue'; to
import App from './App.vue'; and it fix the error. Thanx to Derek for help
It could also be, because your node_modules, is not at the root of the project.
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