Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

dsimensen's avatar

Trying to follow Vue.js tutorial and getting an error I can't figure out

So, when I'm trying to import Message I get this error:

Failed to compile.

./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/App.vue
Module not found: Error: Can't resolve './components/Message.vue' in '/Users/user/Documents/Web Dev/my-app/src'
 @ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/App.vue 9:0-47
 @ ./src/App.vue
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js

Not exactly sure what to do here.

<script>

  import Message from './components/Message.vue';

  export default {
    name: 'app',
    components: {
      Message
    },
    data() {
      return {}
    }
  }
</script>
<script>
    export default {
        name: "Message"
    }
</script>
0 likes
3 replies
deepu07's avatar

@dsim did you create Message.vue component file? it seems like it is not able to find that component. also, did you add this component in public/app.js file?

martinbean's avatar
Level 80

@dsim The path is wrong. So do you actually have a file at ./src/components/Message.vue? Because the error message is suggesting you don’t.

dsimensen's avatar

I don't! Wow, I didn't even notice I missed a folder in the path. Thank you for your answer.

Please or to participate in this conversation.