V
V
Valentin Birulya2020-07-17 21:44:00
webpack
Valentin Birulya, 2020-07-17 21:44:00

Why doesn't VUE code compile?

I’ll say right away that I’m sure it’s a child’s mistake. I

started studying Vue, I’m watching a video and I repeat, but there is a problem, I did everything like it, but it doesn’t compile for me ...

Error text
Failed to compile.
./src/App.vue?vue&type=script&lang=js& (./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/App.vue?vue&type=script&lang=js&)
Module not found: Error: Can't resolve '@/сomponents/TodoList' in 'C:\Users\gerg2\Desktop\hello world\First-vue-app\src'

Script:
<script>
<template>
  <div id="app">
      <h1>Hello world!</h1>
      <hr>
    <TodoList />
  </div>
</template>

<script>
import TodoList from '@/сomponents/TodoList'

export default {
  name: 'App',
  components: {
   TodoList
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>

It seems that the path was indicated in the same way ...

Here is the arrangement of files:5f11f153b5af2314793541.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
origami1024, 2020-07-17
@nykakdelishki

Most likely TodoList.vue is written using the Russian layout either in the file name or in the link code

K
Kitta, 2020-07-18
@kitta

It's not entirely clear how you have webpack configured. Does it automatically resolve the vue filename without extension (default, no extra setting). So maybe you just need to write the path to the component with the extension import TodoList from '@/components/TodoList.vue'. If, nevertheless, everything is in the webpack in the resolve section, then, as origami1024 advises, try re-typing the path. The letter 'c' is very tricky.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question