SergeyMell / nativescript-plugins

Apache License 2.0
14 stars 4 forks source link

Can't resolve nativescript-svg #3

Closed vikasacharya16 closed 3 years ago

vikasacharya16 commented 3 years ago

I'm getting this error and project can't build

home-page.xml

<Page loaded="pageLoaded" xmlns="http://www.nativescript.org/tns.xsd" xmlns:svg="nativescript-svg">

    <ActionBar title="Home">
    </ActionBar>
    <ScrollView>
        <StackLayout class="home-panel">
             <svg:SVGImage src="~/images/om.svg" height="100" />
        </StackLayout>
    </ScrollView>
</Page>
ERROR in ./views/home-page.xml
Module not found: Error: Can't resolve 'nativescript-svg' in 'E:\others\MyApp\app\views'
 @ ./views/home-page.xml 1:62-89 2:71-98
 @ . sync (?<!\bApp_Resources\b.*)(?<!\.\/\btests\b\/.*?)\.(xml|css|js|(?<!\.d\.)ts|(?<!\b_[\w-]*\.)scss)$
 @ ./app.js
SergeyMell commented 3 years ago

The correct XML namespace defining should be done with the full name of the plugin i.e.

<Page xmlns="http://www.nativescript.org/tns.xsd" 
      xmlns:svg="@sergeymell/nativescript-svg" loaded="pageLoaded" >
  ...
</Page>

My fault, documentation was wrong. Fixed the documentation