Skip to content

nativescript-svg: Building Library results in "This dependency was not found" #8

@dangrima90

Description

@dangrima90

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:

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:

image

Could this be related to the issue we're having?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions