Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Ivy compilation #22

Open
awadeson opened this issue Nov 7, 2023 · 5 comments
Open

Support Ivy compilation #22

awadeson opened this issue Nov 7, 2023 · 5 comments

Comments

@awadeson
Copy link

awadeson commented Nov 7, 2023

Could a change be made which would update @sergeymell/nativescript-svg to support Ivy partial compilation as described in this Angular blog post.

In the codebase I work on, @sergeymell/nativescript-svg is the only dependency that generates this message during build:

ERROR in src/app.module.ts:89:5 - error NG6002: 'NativeScriptSvgModule' does not appear to be an NgModule class.

89     NativeScriptSvgModule,
       ~~~~~~~~~~~~~~~~~~~~~

  node_modules/@sergeymell/nativescript-svg/angular/nativescript-svg-module.d.ts:1:22
    1 export declare class NativeScriptSvgModule {
                           ~~~~~~~~~~~~~~~~~~~~~
    This likely means that the library (@sergeymell/nativescript-svg/angular) which declares NativeScriptSvgModule is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

webpack 5.89.0 compiled with 1 error in 36577 ms

The availability of SVG plugins for angular & nativescript is quite poor, so this is a really useful library

Thanks in advance

@guillemc23
Copy link

I bumped into the same error while updating to Angular 16. It would be amazing to keep using this plugin! Thank you!

@itmor
Copy link

itmor commented Nov 20, 2023

теж те саме, треба виправити цю проблему

@R-chie
Copy link

R-chie commented Jan 30, 2024

+1

@R-chie
Copy link

R-chie commented Feb 1, 2024

@awadeson @guillemc23 did you find workaround?

@guillemc23
Copy link

@awadeson @guillemc23 did you find workaround?

Hey @R-chie! I did find a workaround. Instead of importing the module, I'm registering the View, and it works (I have an app in production):

import { registerElement } from "@nativescript/angular";
import { SVGImage } from "@sergeymell/nativescript-svg";
registerElement("SVGImage", () => SVGImage);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants