相关文章推荐
活泼的椰子  ·  python中tk的simpledialog ...·  1 年前    · 
重情义的杯子  ·  基于深度学习的锂电池寿命预测属于某行业物联网 ...·  1 年前    · 
呐喊的槟榔  ·  Nginx之——配置WebSocket_wa ...·  3 年前    · 
悲伤的电影票  ·  第十八章 ...·  3 年前    · 
Code  ›  Vue.JS Error: This relative module was not found - The Coding Couple
https://www.thecodingcouple.com/vue-js-error-this-relative-module-was-not-found/
爱喝酒的荔枝
10 月前
  • Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

The Coding Couple

Pair programming is a lifetime commitment.

  • Home
  • Categories
  • Arduino
  • JavaScript
  • Python
  • Raspberry Pi
  • About Us
  • Privacy Policy
  • Contact

Vue.JS Error: This relative module was not found

October 20, 2019 by Ashley

I was making an update to a small Vue.JS side project when I encountered a build error:

This relative module was not found error message

ERROR Failed to compile with 1 errors 6:00:20 AM

This relative module was not found:

* ./components/ProficiencyBar.vue in ./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/components/SkillSection.vue?vue&type=script&lang=js&

My most recent change was a refactor that involved the creation of a new component: ProficiencyBar . At first I thought, Oh I must have typoed the component name . But once I verified all my spelling was correct, I was stumped. A few Google searches later I came across a GitHub issue describing the same issue as mine . The solution? Delete the /node_modules/.cache folder.

node_modules/.cache folder

Unfortunately, deleting the folder didn’t solve the error, but it led me to the another potential solution to my problem. I looked at Vue component linked in the GitHub issue and noticed a section missing from mine: the components . In my refactor I forgot to add the ProficiencyBar to the SkillSection components.

import ProficiencyBar from './components/ProficiencyBar.vue'; export default { name: 'SkillSection', props: ['skills'], components: { ProficiencyBar

However, to my shock and disappointment, that glaring omission still didn’t resolve my original error.

Another Google search later, I found another GitHub issue with the same error . The solution there: changing the import style. In their case it went from using the @ symbol to dot notation for relative path. Since I was already using the dot notation, I decided to give the @ symbol a try and it worked!

import ProficiencyBar from '@/components/ProficiencyBar.vue';

Now the question is why? Unfortunately, I’ll have to answer that another day.

Let’s be friends!

  • Instagram: @thecodingcouple
  • Twitter: @thecodingcouple
  • GitHub: @thecodingcouple

Related Posts

  • Error: [🍍]: “getActivePinia()” was called but there was no active Pinia Error: [🍍]: “getActivePinia()” was called but there was no active Pinia
  • Uncaught TypeError: util.inherits is not a function Uncaught TypeError: util.inherits is not a function
  • 5 Ways to Improve Your Debugging Skills 5 Ways to Improve Your Debugging Skills
  • Avoid using mutable values as default parameter values in Python (Today I Learned) Avoid using mutable values as default parameter values in Python (Today I Learned)
  • How to watermark images with Python and Pillow (PIL) How to watermark images with Python and Pillow (PIL)
  • Surviving the Hackathon:  Angular Attack 2016 Surviving the Hackathon: Angular Attack 2016

Filed Under: Debugging , JavaScript , Programming Languages Tagged With: debugging , vuejs

Previous Post: « DevSpace 2019 Recap
Next Post: .mjs extension (A JavaScript module file) | Today I Learned »

Primary Sidebar

Social Media

  • GitHub
  • Instagram
  • Twitter
  • YouTube

Recent Posts

Pokémon Color Picker | A web app built with HTML/CSS + JavaScript Pokéball Single DIV CSS Drawing | Tutorial Error: [🍍]: “getActivePinia()” was called but there was no active Pinia Trijam #261 Game Jam Diary: One Wrong Move Using WSL on Corporate VPN

Recent Comments

  • Lizzy on Creation Crate Month 2: An Arduino Powered Memory Game
  • Ashley Grenon on Creation Crate Month 2: An Arduino Powered Memory Game
  • Lizzy on Creation Crate Month 2: An Arduino Powered Memory Game
  • kelly on Creation Crate Month 2: An Arduino Powered Memory Game
  • Ashley on Creation Crate Month 3: An Arduino Powered Distance Detector

Footer

About Us

The Coding Couple: Ashley and Michael

We are the Coding Couple.  Two people who met in college and decided they wanted to pair program for the rest of their ...

Read More »

Most Recent Posts

Pokémon Color Picker | A web app built with HTML/CSS + JavaScript

Pokéball Single DIV CSS Drawing | Tutorial

Error: [🍍]: “getActivePinia()” was called but there was no active Pinia

Trijam #261 Game Jam Diary: One Wrong Move

Social Media

  • GitHub
  • Instagram
  • Twitter
  • YouTube

© The Coding Couple, 2015 – 20235. Excerpts and links may be used, provided that full and clear credit is given to The Coding Couple with appropriate and specific direction to the original content.

 
推荐文章
活泼的椰子  ·  python中tk的simpledialog.askstring报错解决方案 - 顺其自然,道法自然 - 博客园
1 年前
重情义的杯子  ·  基于深度学习的锂电池寿命预测属于某行业物联网数据分析吗 - CSDN文库
1 年前
呐喊的槟榔  ·  Nginx之——配置WebSocket_was not upgraded to websocket_冰 河的博客-CSDN博客
3 年前
悲伤的电影票  ·  第十八章 Python批量管理主机(paramiko、fabric与pexpect)-阿里云开发者社区
3 年前
今天看啥   ·   Py中国   ·   codingpro   ·   小百科   ·   link之家   ·   卧龙AI搜索
删除内容请联系邮箱 2879853325@qq.com
Code - 代码工具平台
© 2024 ~ 沪ICP备11025650号