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
Failed import NgxEchartsModule in a Standalone Component #366
Comments
I guess it would be better to abandon the forRoot pattern and try to use injection tokens to provide the echarts library. |
I am trying like this anf still getting error but different error.
the error in console log is |
I found the way to fix it. I am trying from this https://stackoverflow.com/questions/63176047/typeerror-cannot-destructure-property-init-of-object-null-as-it-is-null-in I import echart in app.module
then in standalone component I just add the |
is there anyone can import with standalone components ? |
we can try this way. It's working fine for me
|
In this example, the problem is the factory is returning the import directly instead of a config object. The correct statement would be: However in any case I suggest
By loading it this way, you lose the benefit of lazy-loading the library, so the entire package will be bundled with your component. |
When I use this solution i have this error
|
iiuc this imports the whole bundle? how to only import used parts? |
Fixed via #411. Here is the documentation: https://github.com/xieziyu/ngx-echarts/tree/v17.1.0#standalone |
I think this ngx-echarts v14 is still not support the standalone component feature.
the documentation does not provide how to import NgxEchartsModule in the standalone component.
I have imported NgxEchartsModule with forRoot in app.module.ts with the old bootstrap way.
if I import just NgxEchartsModule without root, appears error in echarts directive on the html tamplate.
if I import NgxEchartsModule with forRoot, appears error in imports section in @component.
The text was updated successfully, but these errors were encountered: