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

Error when importing module #8

Open
tklein243 opened this issue Jan 21, 2020 · 3 comments
Open

Error when importing module #8

tklein243 opened this issue Jan 21, 2020 · 3 comments

Comments

@tklein243
Copy link

When ever I use the angular module I get either one of the following two Errors.

import { HighchartsModule } from "nativescript-ui-highcharts";

When I do that the following Error:

'"nativescript-ui-highcharts"' has no exported member 'HighchartsModule'.'

I tried fixing this by doing the following:

import { HighchartsModule } from "nativescript-ui-highcharts/angular";

which fixes the import error but then the TNS build fails and throws the following Error:

CONSOLE ERROR file:///node_modules/@angular/core/fesm5/core.js:4002:0: ERROR Error: Uncaught (in promise): Error: Cannot find module 'Developer/CoreSimulator/Devices/F19F1BA2-1FEE-4609-92EA-DA2F268E69DE/data/Containers/Bundle/Application/E88BD4B3-DD82-4545-B692-323FD861D248/frontendlibraries.app/app/highcharts.xml'

I followed the exact steps from the readme. Is there anything else I have to do?

TNS-version is 6.3

Thank you in advance!

@mhtghn
Copy link
Owner

mhtghn commented Jan 21, 2020

Can you remove the imports and add the lines below and tell me if it works so I can update the ReadMe

import {registerElement} from "nativescript-angular/element-registry";

registerElement("Highcharts", () => require("nativescript-ui-highcharts").Highcharts);

@tklein243
Copy link
Author

That did not work either.

What worked for me was replacing line 18 in highcharts.js.

I replaced this:

var innerComponent = builder.parse(require(__dirname + '/highcharts.xml'));

with this:

var innerComponent = builder.parse(require('./highcharts.xml'));

@mhtghn
Copy link
Owner

mhtghn commented Feb 20, 2020

Hi @tklein243, a new version has been published 1.2.1 with your correction.

Can you try it and confirm that it works now ?

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

2 participants