Highcharts: The type definition of highstock is incorrect

Created on 18 Dec 2018  路  23Comments  路  Source: highcharts/highcharts

Expected behaviour

import the highstock types correctly.

Actual behaviour

import with build errors

Live demo with steps to reproduce

Just install the v7 highcharts and drilldown to see node_modules/highcharts/highstock, the path is invalid

image

Product version

v7.0

Affected browser(s)

ALL

Docs Bug

Most helpful comment

Just to make sure, that everyone gets notified: The v7.0.2 update has been released and fixes this issue.

All 23 comments

Thank you for the report! This will be indirectly resolved with https://github.com/highcharts/highcharts/pull/9692

@bre1470 how does the PR resolve the problem. The changes inside it doesn't involve related code.

The fix is part of v1.0.5 of the declarations generator.

@scott-ho
If you need to load Highstock with current version in your project you could use a module.
Workaround: load stock as a module, so like:

import * as Highcharts from 'highcharts';
import StockModule from 'highcharts/modules/stock';
StockModule(Highcharts);

I'm afraid that it's not very feasible. We have many many imports from highstock.

BTW. When will it be released?

Highcharts v7.0.1 will be released this week and fix the problem.

It looks like even in v7.0.1, the path in highcharts/highstock.d.ts is wrong:

import StockModule from '../modules/stock';

@gbenthomas Thank you very much for finding this one out. Only that file has this problem.

As a workaround you could use un-minified version of Highstock that has correct .d.ts

@bre1470 Looks like a single typo.

I am sorry for this. The bug actually should have been detected by dtslint here: https://github.com/highcharts/highcharts/blob/master/test/typescript/highstock.ts#L17 , because the stockChart factory is only available, if the stock module declaration can be found.

We will now improve our test systems, so it detects bugs in general more reliable.

Hope this could be fixed soon.

Is there a timeline for this fix to be released?

The fix is expected to be published within next few weeks. It should be a part of next path release (7.0.2 or any next version of Highcharts that will be published) if a new version of declarations generator (probably 1.0.6) will be included there with the typo fix (at this very moment the fix is a part of 1.0.6 version of the declarations generator).

tl;dr ETA within next few weeks.

Well, this error makes the lib unusable, because when you are building on CI, it uses 7.0.1 version without the change/workaround you are mentioning, couldn't you make a quick fix and release 7.0.2?

This issue is now fixed with the master branch and will be part of the next release, due within a few weeks.

How much is a few? The thing I'm wondering, why can't you bump minor version to 7.0.2 and release that (or even 7.1.0)? And if you have one additional major release coming that's fine, you can bump it again later?

I'm not trying to be ungrateful here, but to me it seems really critical issue to leave it hanging for weeks just because it doesn't match release plan.

We prepare v7.0.2 for release in the next ten days.

Honestly, I wish my clients have 7-10 days waiting time. Alot has been added to highchart 7 such as cylinder chart type and a more advanced exporting functionality. Being unable to use this is frustrating especially when it's a requirement.

When you import highstock from the src files, there is not this issue:

import * as Highstock from 'highcharts/highstock.src';

Thank you for your feedback, @chukwu. We are sorry for the frustration this bug is causing.

The workarounds mentioned by @KacperMadej and @cebor (Thank you!) are helpful temporary solutions during the development process, which you should consider:

import * as Highcharts from 'highcharts';
import StockModule from 'highcharts/modules/stock';
StockModule(Highcharts);

聽- or -

import * as Highstock from 'highcharts/highstock.src';

The main issue for me is with angular-highchart plugin/wrapper. The plugin doesn't work with highchart ~7 as pointed in https://github.com/cebor/angular-highcharts/issues/250
Plugin developer can't do anything until highchart is fixed. So, I'm forced to install highchart 6.2--

Same for us we need to wait, but looking forward to try / fix the new better official beta Highcharts types instead of DefinitelyTyped types ;-)

Thanks for the effort to push things forward for better Typescript support.

Just to make sure, that everyone gets notified: The v7.0.2 update has been released and fixes this issue.

Thanks for the quick release Highcharts team! Really appreciated :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ananth-imagin picture ananth-imagin  路  3Comments

madreason picture madreason  路  3Comments

vivekk123 picture vivekk123  路  3Comments

balupton picture balupton  路  3Comments

Dunge picture Dunge  路  3Comments