-
Notifications
You must be signed in to change notification settings - Fork 4
Description
I'm currently working on a project where we're building our code into an npm package which we can then use internally across different projects. I've just added nativescript-svg plugin to allow us to have an icon component.
We're using nativescript-vue - the plugin works well with vue as we are already using the plugin in other apps. However when trying to build we get the following error:
This dependency was not found .... To install it, you can run: npm install --save @sergeymell/nativescript-svg/index.
This is the code we have, all that's happening is that we have a wrapper component around the SVGImage and we're making use of the fromData function.
<template>
<SVGImage
width="32"
height="32"
:src="svgImage"
/>
</template>
<script lang="ts">
import { defineComponent } from "@vue/composition-api";
import { fromData } from "@sergeymell/nativescript-svg";
import WebIcon from "./Icon.vue";
export default defineComponent({
extends: WebIcon,
computed: {
svgImage() {
return fromData(this.svg);
}
}
});
</script>
You will notice that the error I listed above states that the module to instal is @sergeymell/nativescript-svg/index. My suspicion is that this is happening because of the following setup:
| "main": "index", |
What I noticed is that the main file in the package.json is referencing index which doesn't seem to exist in the package that's being installed in the node_modules:
Could this be related to the issue we're having?
