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

ScalablyTypedConverterPlugin failes with Parse error at 1531.47 ''>'' expected but 'new' found #316

Closed
PawelGizka opened this issue May 27, 2021 · 6 comments · Fixed by #320

Comments

@PawelGizka
Copy link

Hi!

ScalablyTypedConverterPlugin version "1.0.0-beta32" has suddenly started to fail with Parse error at 1531.47 ''>'' expected but 'new' found

[error] java.lang.RuntimeException: TsHelperFile(InFile(js/target/scala-2.13/scalajs-bundler/main/node_modules/typescript/lib/lib.es5.d.ts),StdLibSource(InFolder(js/target/scala-2.13/scalajs-bundler/main/node_modules/typescript/lib),IArray(InFile(js/target/scala-2.13/scalajs-bundler/main/node_modules/typescript/lib/lib.dom.d.ts), InFile(js/target/scala-2.13/scalajs-bundler/main/node_modules/typescript/lib/lib.es6.d.ts)),TsIdentLibrarySimple(std)),IArray(TsIdentModule(None,List(std, lib.es5)))) -> Right(InFile(js/target/scala-2.13/scalajs-bundler/main/node_modules/typescript/lib/lib.es5.d.ts): Parse error at 1531.47 ''>'' expected but 'new' found) [error] at scala.sys.package$.error(package.scala:30) [error] at org.scalablytyped.converter.plugin.ScalablyTypedConverterPlugin$.$anonfun$stImportTask$7(ScalablyTypedConverterPlugin.scala:88) [error] at scala.Function1.$anonfun$compose$1(Function1.scala:49) [error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62) [error] at sbt.std.Transform$$anon$4.work(Transform.scala:68) [error] at sbt.Execute.$anonfun$submit$2(Execute.scala:282) [error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23) [error] at sbt.Execute.work(Execute.scala:291) [error] at sbt.Execute.$anonfun$submit$1(Execute.scala:282) [error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265) [error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:64) [error] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [error] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [error] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [error] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [error] at java.lang.Thread.run(Thread.java:748)
I think that Converter cannot handle this line:
type ConstructorParameters<T extends abstract new (...args: any) => any> = T extends abstract new (...args: infer P) => any ? P : never; but I'm not sure

@PawelGizka
Copy link
Author

PawelGizka commented May 27, 2021

I've tried to downgrade ScalablyTyped to "1.0.0-beta31" and "1.0.0-beta29.1" but it's still the same.

@oyvindberg
Copy link
Collaborator

Thanks! Yeah that makes sense. That syntax is new and I haven't added it yet. It's probably quite easy to add, I'll get it done in the weekend probably.

Meanwhile you can specify explicitly a lower version of typescript with stTypescriptVersion sbt setting

@rpiaggio
Copy link

Thank you @oyvindberg . I have the same issue but it seems to work fine with stTypescriptVersion := "4.2.4".

@PawelGizka
Copy link
Author

Thank you @oyvindberg . It also works fine for me with stTypescriptVersion := "4.2.4".

@oyvindberg
Copy link
Collaborator

That's great. Also a reminder that it's a good idea to use yarn and check in the lock file to avoid surprises like this, otherwise you get can get new versions at any moment really

@oyvindberg
Copy link
Collaborator

Released fix in 1.0.0-beta33

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

Successfully merging a pull request may close this issue.

3 participants