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

Stack overflow when importing echarts #538

Open
mlvn23 opened this issue Jun 2, 2023 · 2 comments
Open

Stack overflow when importing echarts #538

mlvn23 opened this issue Jun 2, 2023 · 2 comments

Comments

@mlvn23
Copy link

mlvn23 commented Jun 2, 2023

Hello! Thank you for working on this project. I find it very useful and I've been migrating everything I have.

I've tried to import echarts (v5.4.2), and I'm getting a stack overflow:

[error] PhaseRes.scala:81  StackOverflowError [thread => 1803, project => echarts, ms => 7951, phase => typescript, id => echarts]java.lang.StackOverflowError
[error]         at org.scalablytyped.converter.internal.ts.TsTreeScope$Entry$Idents.equals(TsTreeScope.scala:184)
[error]         at scala.runtime.BoxesRunTime.equals2(BoxesRunTime.java:137)
[error]         at scala.runtime.BoxesRunTime.equals(BoxesRunTime.java:123)
[error]         at scala.collection.LinearSeqOptimized.contains(LinearSeqOptimized.scala:105)
[error]         at scala.collection.LinearSeqOptimized.contains$(LinearSeqOptimized.scala:102)
[error]         at scala.collection.immutable.List.contains(List.scala:91)
[error]         at org.scalablytyped.converter.internal.ts.TsTreeScope$LoopDetector.including(TsTreeScope.scala:169)
[error]         at org.scalablytyped.converter.internal.ts.TsTreeScope.lookupInternal(TsTreeScope.scala:94)
[error]         at org.scalablytyped.converter.internal.ts.TsTreeScope.lookupInternal$(TsTreeScope.scala:89)
[error]         at org.scalablytyped.converter.internal.ts.TsTreeScope$Scoped.lookupInternal(TsTreeScope.scala:277)
[error]         at org.scalablytyped.converter.internal.ts.TsTreeScope$.$anonfun$search$4(TsTreeScope.scala:507)
[error]         at org.scalablytyped.converter.internal.IArray.map(IArray.scala:469)
[error]         at org.scalablytyped.converter.internal.ts.TsTreeScope$.search(TsTreeScope.scala:478)
[error]         at org.scalablytyped.converter.internal.ts.TsTreeScope$Scoped.local$1(TsTreeScope.scala:349)
[error]         at org.scalablytyped.converter.internal.ts.TsTreeScope$Scoped.lookupImpl(TsTreeScope.scala:420)
[error]         at org.scalablytyped.converter.internal.ts.TsTreeScope.lookupInternal(TsTreeScope.scala:110)
[error]         at org.scalablytyped.converter.internal.ts.TsTreeScope.lookupInternal$(TsTreeScope.scala:89)
[error]         at org.scalablytyped.converter.internal.ts.TsTreeScope$Scoped.lookupInternal(TsTreeScope.scala:277)
[error]         at org.scalablytyped.converter.internal.ts.TsTreeScope.lookupBase(TsTreeScope.scala:78)
[error]         at org.scalablytyped.converter.internal.ts.TsTreeScope.lookupBase$(TsTreeScope.scala:70)
[error]         at org.scalablytyped.converter.internal.ts.TsTreeScope$Scoped.lookupBase(TsTreeScope.scala:277)
:

It looks like it's failing because it reused the same name in the final line when it tries to do the exports. Here's a simplified pattern that can reproduce the issue:

declare type SeriesInjectedOption = {
    markArea?: number;
};

interface BoxplotSeriesOption {
    type?: 'boxplot';
}

declare type BoxplotSeriesOption$1 = BoxplotSeriesOption & SeriesInjectedOption;

export {BoxplotSeriesOption$1 as BoxplotSeriesOption};

If I comment the last line, it would work. Same goes for the echarts.d.ts.

@oyvindberg
Copy link
Collaborator

Thanks for the analysis and repro! I keep getting surprised at all the... interesting things people do :)

I'll get to this for the next release, sorry I don't have the time right now

@xerial
Copy link
Contributor

xerial commented Jun 14, 2023

I hit the same issue when I tried to test echarts.

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

3 participants