Error: Swiper dependency was not located in the Typescript and Ionic-Vue project

Looking to switch from ion-slides to swiper due to limitations with dynamic rendering.

After correctly adding

<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7e0d09170e1b0c3e49504e504f">[email protected]</a>
in the package.json file, I followed the documentation to import the packages into the Vue component (Home.vue). However, I encountered the following error:

This dependency was not found:

* swiper/vue in ./node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/ts-loader??ref--14-2!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./src/views/Home.vue?vue&type=script&lang=ts

To install it, you can run: npm install --save swiper/vue

I'm uncertain whether the issue lies with the tsconfig.json file, as for testing purposes, I successfully installed the vue3-circle-progress package which works without errors.

Please advise if there is an issue with my tsconfig or if the correct swiper package is missing.

Thank you.

Files:

Home.vue

<template>
  <!-- Vue component code here -->
</template>

<script lang="ts">
import {
  // Imports here
} from "@ionic/vue";
import { GetNewests } from "../services/home";
// Other imports...

export default {
  // Component details...
};
</script>

package.json

{
  // Package.json content
}

tsconfig.json

{
  // Tsconfig.json content
}

Answer №1

Everything seems to be in order, the only discrepancy I noticed compared to my project implementation is the version number. In my case, I am using

"swiper": "^6.7.5"

Perhaps try deleting the node_module directory and then running an npm install

I have a detailed video explanation on this topic available here - https://youtu.be/pyqHuJSAgeY

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

Is it possible to update the page title in Ionic v1 without impacting the navigation bar title?

After updating the ion-view title attribute, I noticed that the title changes on both the navigation bar and browser tab. Is there a way to only modify the title displayed on the browser tab? ...

Breaking a line while concatenating enhances the readability of the code

Why does the array add a line break between the second to last and last elements when I print it into the debug console after performing this function? function addToList(URL) { GetWebExceptions(); //defines GExceptionList GExceptionList = GExcept ...

Exploring the attrTween function in Angular with D3 insights

I'm currently trying to grasp the concept of utilizing the function attrTween in D3. My goal is to create a pie-chart using the example found at http://bl.ocks.org/mbostock/5100636. However, I've encountered some challenges when it comes to the ...

React - input value for creating a numerical outcome is not functioning as expected

I'm currently in the process of learning React and have encountered an issue with my input field. I am attempting to have the input receive a number and then pass that number when the submit button is clicked. Most of the functionality is working as e ...

Problem arising from reduxjs/toolkit - unable to execute action dispatch

As I delve into learning React, focusing on reactjs/toolkit in this specific section, I am working through a series of basic examples to enhance my understanding. One particular example involves simulating a user logging into their account. Despite identif ...

What is the best way to save Azure Service Bus Message IDs with a package-internal type of 'Long' in MongoDB?

Currently, I am utilizing Azure Service Bus (@azure/service-bus) within a TypeScript-based nest.js service to schedule messages for delivery at a future date. In case the need arises, I must also have the ability to cancel these scheduled messages before t ...

Display or conceal a div when hovering over dropdown menu choices

$('#dropdown-list').on('change',function(){ if( $(this).val()==="option 1" ){ $("#diva").hide() } else { $("#divb").show() } }); The code above is being used to hide or show a div based on a dropdown selection, which is f ...

Error in Node.js: The res.send method is undefined

I'm having some issues with my first attempt at creating a simple Counter Strike API bot using nodeJS. The problem lies with the res.send function, as I keep getting an error message saying "res.send is not a function" every time I try to use it. Movi ...

Render JSON data retrieved from an AJAX request as a formatted HTML display or table

Code for displaying JSON data $('body').on('click','#check_history',function () { var settings = { "async": true, "crossDomain": true, "url": "https://url.com", ...

The slice method for copying arrays seems to be malfunctioning

It's perplexing that even after utilizing distances.slice(), I end up modifying the original array when I make changes to the new copy. What could be causing this unexpected behavior? var distances = [ ['-1', '10', '-1&ap ...

typescript dispatch issue

Whenever I attempt to send this dispatch, it consistently results in the following error message (and the same issue occurs with all my other dispatches): The argument of type '(dispatch: Dispatch) => Promise' is not compatible with a paramet ...

JavaScript API for Outlook appointment object

Is there a way to change the appointment busy status "show as" to out of office using JavaScript in an Outlook web add-in? Also, how can I alter the value of all day event to true (tick it) using JavaScript in an Outlook web add-in? Any insights would be ...

You cannot pair Reanimated 2 withSequence using a direct value

Trying to implement withSequence with a direct value as the initial input resulted in crashing the application. animatedValue.value = withSequence(startValue, withTiming(endValue)); Although the following code appeared to be functioning correctly, it did ...

Is it considered poor practice in TypeScript to manually set the type when the type inference is already accurate?

Is it necessary to explicitly set the variable type in TypeScript when it is inferred correctly? For example: const add = (a: number, b: number) => a + b; const result = add(2, 3); // Or should I explicitly declare the return value type? const add = ...

Issue with binding Vue v-model to input element in Parent component is not functioning as expected

Utilizing Vue, Nuxt, and Vue Good Table to implement live searching on a table has presented a challenge for me. I created a child component called child.vue and imported it into the parent page named parent.vue. To bind the searchTerm with the input eleme ...

The Bootstrap carousel is experiencing unresponsiveness

While I successfully built a carousel for my clients that works perfectly on non-bootstrap platforms, I encountered some issues when trying to make it responsive on Bootstrap. It seems that there is a JavaScript issue that is preventing it from working pro ...

How can I retrieve the line number of a code during runtime in JavaScript?

Is there a way to add a console.log statement that would indicate the line number it is on in JavaScript? For example: console.log ('Line:', [code to get the line]). The output in the console would be Line: [line number], helping me identify wher ...

Do Angular FormControl objects have the capability to accept input values of various types, or are they limited to TypeScript primitive types?

When creating a reactive form in Angular using FormControl objects in a FormGroup, I encountered an issue. While passing primitive arguments as values for an HTML input select control works fine, when passing an object of a self-defined class, the value in ...

Ways to verify the click status of a button prior to initiating an AJAX request with jQuery?

I am facing an issue with a button that needs to be clicked by the user before submitting the form. Here's the code snippet for the button: $('#chooseButton') .on( 'click', function() { console.log("user ha ...

When I click on the button, the page reloads instead of executing the essential code

On my website, there is a settings page where users can edit their profiles. After editing, they click the update button which triggers the updateProfileData function. This works smoothly in Chrome browser, but in Firefox, the page reloads as soon as the b ...