Vuejs compilation encountered an error with one issue: Module not found relatively

Encountering an error while compiling after creating PostService.js and making an API call. The error message reads:

ERROR  Failed to compile with 1 errors                                                       12:54:44 AM
This relative module was not found:

* ../components/PostFrom.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/views/Home.vue?vue&type=script&lang=js&

Following is a list of my development dependencies in package.json:

"devDependencies": {
    "@vue/cli-plugin-babel": "^4.4.6",
    "@vue/cli-plugin-eslint": "^4.4.6",
    "@vue/cli-service": "^4.4.6",
    "babel-eslint": "^10.1.0",
    "eslint": "^7.5.0",
    "eslint-plugin-vue": "^6.2.2",
    "vue-style-loader": "^4.1.2",
    "vue-template-compiler": "^2.6.11"
  },

Here is a breakdown of my file structure:

src
    assets
    components
      Navbar.vue
      PostForm.vue
    views
      About.vue
      Home.vue
    App.vue
    main.js
    PostService.js
    router.js

App.vue

<template>
  <div>
    <Navbar></Navbar>
    <div class="container">
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
import Navbar from "./components/Navbar";
import "../node_modules/materialize-css/dist/css/materialize.min.css";
import "../node_modules/materialize-css/dist/js/materialize.min.js";

export default {
  name: "App",
  components: {
    Navbar,
  },
};
</script>

<style></style>

Home.vue

PostForm.vue

PostService.js

main.js

Have attempted various troubleshooting steps like reinstallation of node_modules, clearing cache folders, and npm updates without success. Vue version being used is 4.1.2 along with node version 12.14.0. Any assistance on resolving this issue would be highly appreciated. Thank you for your help.

Answer №1

There appears to be a typo in your code. The component's filename is PostForm.vue, yet you are attempting to import it as PostFrom.vue in the file Home.vue.

To resolve this issue, make sure to use the correct filename when importing the component.

Answer №2

One common mistake is renaming a component without updating the file name

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Sending the object context back to the controller callback from an AngularJS Directive

I am currently working on creating a modified version of ng-change with a delay feature for auto-saving changes. Here is the custom directive I have implemented: myApp.directive('changeDelay', ['$timeout', function ($timeout) { re ...

JQuery requests functioning flawlessly on one system while encountering issues on other systems

I've encountered an issue with the code on my admin page. It used to work perfectly fine on my system, but now it seems to have stopped functioning. My client urgently needs to update this page, however, when I attempt to run it, the JQuery requests a ...

Obtaining the index of a modified array in vuejs using $watch

Currently, I am working with an array of objects: ({"code":"id1","color":"red","description":"eg1"}) Each object in the array contains input fields. Users have the ability to dynamically add and remove these objects. My goal is to automatically populate ...

Storing a PDF created with Laravel in a queue

I have a tool that converts HTML to PDF and saves it locally. I also use a live URL to fetch another PDF and save it on my local machine. Then, I utilize a Laravel library to merge both PDFs into a single file through embedding. Previously, this process ...

retrieve essential data from Firebase using JavaScript

Currently, I am utilizing the get() method to retrieve data in my React Native application. Here is the code snippet that I am using: firebase .firestore() .collection("users") .doc("test") .get() .then(response => { console.log(respo ...

What is the best way to combine a require statement and a function in CoffeeScript?

I'm trying to accomplish this task: require('./config/enviroment.js')(app, express); However, I am unsure of the proper method... I attempted: require './config/routes.js'(app, routes) -> Resulting in: require('./conf ...

Developing a table with JavaScript by parsing JSON data

Starting off, I am relatively new to working with JavaScript. Recently, I attempted to generate a table using data from a JSON file. After researching and following some tutorials, I successfully displayed the table on a web browser. However, I noticed tha ...

What steps can be taken to prevent an event from being triggered once it has already started but has not yet concluded?

Let's talk about the navigation bar on the website. Clicking on it toggles the menu holder to slide in and out from the side. It's a simple interaction. The bar contains an icon with the text 'MENU'. When you open the menu, the icon cha ...

Is it possible to connect to the Oculus Go controller using the GamePad API within the Oculus Browser

Exploring my three.js apps on the new Oculus Go has led me to question whether I can interact with the controller solely through the GamePad API supported by major browsers. Although Oculus documentation suggests using OVRManager in Unity or Unreal Bluepri ...

How can I display an iframe element only if it exists within an object in Angular?

I'm currently exploring options to specifically display the iframe element within a block of HTML content being sent to my Angular application. While I can use a *ngIf directive in my template to check for the presence of the tag, I am unsure of how ...

Switch between images using JavaScript or JQuery

I am looking for a way to switch between "edit.png" and "ok.png" images on my web page. When the page initially loads, it displays buttons with "edit.png" images, as shown in the screenshot https://i.sstatic.net/QmgdM.png My goal is to have the image rema ...

Can you explain the error message "Uncaught TypeError: seats[Symbol.iterator] is not a function" in simpler terms?

I am currently developing a movie seat booking application, but unfortunately, I encountered an error when running the code. According to the Google console, the error is located on line 224 and it states "Uncaught TypeError: seats[Symbol.iterator] is not ...

redux reducer failing to update state within store

I am completely new to redux and still have a lot to learn. I am currently working on a project that requires setting up a redux store and using state from that store. However, as I try to update the state through a reducer, the code fails to work properly ...

Incorporating <span> elements into a comma-separated list using Jquery on every other item

When I receive a comma-separated list of items from a database and insert them into a table cell, I want to apply alternating styles to make it easier for users to distinguish between them. For example: foo, bar, mon, key, base, ball I'm looking to ...

How can I retrieve the identical fingerprint used by AWS from x.509 using node-forge?

Is there a way to obtain the certificate ID / fingerprint of an x.509 certificate using the node-forge library? Update I am trying to configure AWS IoT and believe that AWS uses a specific fingerprint algorithm to generate the certificate ID. This inform ...

Attempting to create an array of objects, only to receive an array filled with blank objects

As a newcomer to JavaScript, I'm facing a challenge that I can't seem to solve. I have an array of objects with two attributes each, and my goal is to pair these attributes where one acts as the key and the other as the value. This is my current ...

exploration of unique npm packages with vue-loader in development

After configuring my project with vue-loader, I included several postcss plugins in the designated config file. Now, I aim to integrate the GSAP package (downloaded from npm). Where should I insert the code for webpack to recognize it? ...

During the scraping process with Puppeteer in NextJs, the execution context was terminated, possibly as a result of a navigation

I'm currently developing an application to search for my music on websites that host illegal content, with the intention of requesting its removal later. While working with puppeteer, I encountered an issue when trying to submit a search query and re ...

Having trouble fetching values in Node.js after a certain period of time has passed

Whenever the page loads, the sha1 function is supposed to run and it should run after 5 seconds. var crypto = require('crypto'); console.log(sha1()); setTimeout(sha1, 5000); console.log(sha1()); function sha1() { var dt = dateTime.create(); ...

Setting up a reactive counter using Vue3

My goal is to have the counter data update after clicking on the setup, but it's not working. What could be causing this issue? Thank you. setup(props) { let count = ref(1) let obj = reactive({ count }) let form = reactive({ name: ...