zio / zio-http

A next-generation Scala framework for building scalable, correct, and efficient HTTP clients and servers
https://zio.dev/zio-http
Apache License 2.0
787 stars 396 forks source link

zio-http 3.0.0-RC10 cannot be compiled with ScalaJS 1.16.0 #3087

Closed dobrynya closed 1 month ago

dobrynya commented 1 month ago

Describe the bug When compiling with fastLinkJS I get the following error message

[error] Referring to non-existent method static java.lang.Long.parseLong(java.lang.CharSequence,int,int,int)long
[error]   called from private zio.http.codec.PathCodec.decodeSubstring(java.lang.String,[zio.http.codec.PathCodec$Opt,java.util.Deque)java.lang.String
[error]   called from zio.http.codec.PathCodec.decode(zio.http.Path)scala.util.Either
[error]   called from private zio.http.codec.internal.EncoderDecoder$Single.decodePaths$$anonfun$1(zio.http.codec.PathCodec,zio.http.Path)java.lang.Object
[error]   called from private zio.http.codec.internal.EncoderDecoder$Single.decodePaths(zio.http.Path,[java.lang.Object)void
[error]   called from private zio.http.codec.internal.EncoderDecoder$Single.decode$$anonfun$2(zio.http.URL,zio.http.codec.CodecConfig,zio.http.Status,zio.http.Method,zio.http.Headers,zio.http.Body,java.lang.Object)zio.ZIO
[error]   called from zio.http.codec.internal.EncoderDecoder$Single.decode(zio.http.codec.CodecConfig,zio.http.URL,zio.http.Status,zio.http.Method,zio.http.Headers,zio.http.Body,java.lang.Object)zio.ZIO
[error]   dispatched from zio.http.codec.internal.EncoderDecoder.decode(zio.http.codec.CodecConfig,zio.http.URL,zio.http.Status,zio.http.Method,zio.http.Headers,zio.http.Body,java.lang.Object)zio.ZIO
[error]   called from zio.http.codec.HttpCodec.decodeResponse(zio.http.Response,zio.http.codec.CodecConfig,java.lang.Object)zio.ZIO
[error]   called from private zio.http.endpoint.internal.EndpointClient.execute$$anonfun$1(java.lang.Object,zio.http.Response)zio.ZIO
[error]   called from zio.http.endpoint.internal.EndpointClient.execute(zio.http.ZClient,zio.http.endpoint.Invocation,zio.ZIO,zio.http.codec.Combiner,java.lang.Object)zio.ZIO
[error]   called from private zio.http.endpoint.EndpointExecutor.apply$$anonfun$2(zio.http.endpoint.Invocation,java.lang.Object,zio.http.endpoint.internal.EndpointClient)zio.ZIO
[error]   called from zio.http.endpoint.EndpointExecutor.apply(zio.http.endpoint.Invocation,java.lang.Object)zio.ZIO
[error]   called from private myorg.frontend.PublicServer.loadKeycloakConfig$$anonfun$1()zio.ZIO
[error]   called from myorg.frontend.PublicServer.loadKeycloakConfig()zio.ZIO
[error]   called from myorg.frontend.security.SecurityService$.make(myorg.frontend.PublicServer)zio.ZIO
[error]   called from myorg.frontend.UnauthenticatedPage.init()scala.Tuple2
[error]   dispatched from myorg.frontend.Component.init()scala.Tuple2
[error]   called from myorg.frontend.MainPage.init()scala.Tuple2
[error]   called from myorg.frontend.App$.init(scala.collection.immutable.Map)scala.Tuple2
[error]   dispatched from tyrian.TyrianApp.init(scala.collection.immutable.Map)scala.Tuple2
[error]   called from private tyrian.TyrianApp._init(scala.collection.immutable.Map)scala.Tuple2
[error]   called from tyrian.TyrianApp.ready(org.scalajs.dom.Element,scala.collection.immutable.Map)void
[error]   called from tyrian.TyrianApp.launch(org.scalajs.dom.Element,scala.scalajs.js.Dictionary)void
[error]   called from tyrian.TyrianApp.$js$exported$meth$launch(org.scalajs.dom.Element,scala.scalajs.js.Dictionary)java.lang.Object
[error]   called from myorg.frontend.App$.$js$exported$meth$launch(org.scalajs.dom.Element,scala.scalajs.js.Dictionary)java.lang.Object
[error]   exported to JavaScript with @JSExport
[error] involving instantiated classes:
[error]   zio.http.codec.internal.EncoderDecoder$Single
[error]   zio.http.endpoint.internal.EndpointClient
[error]   zio.http.endpoint.EndpointExecutor
[error]   myorg.frontend.PublicServer
[error]   myorg.frontend.security.SecurityService$
[error]   myorg.frontend.UnauthenticatedPage
[error]   myorg.frontend.MainPage
[error]   myorg.frontend.App$
[error] Referring to non-existent method static java.lang.Integer.parseInt(java.lang.CharSequence,int,int,int)int
[error]   called from private zio.http.codec.PathCodec.decodeSubstring(java.lang.String,[zio.http.codec.PathCodec$Opt,java.util.Deque)java.lang.String
[error]   called from zio.http.codec.PathCodec.decode(zio.http.Path)scala.util.Either
[error]   called from private zio.http.codec.internal.EncoderDecoder$Single.decodePaths$$anonfun$1(zio.http.codec.PathCodec,zio.http.Path)java.lang.Object
[error]   called from private zio.http.codec.internal.EncoderDecoder$Single.decodePaths(zio.http.Path,[java.lang.Object)void
[error]   called from private zio.http.codec.internal.EncoderDecoder$Single.decode$$anonfun$2(zio.http.URL,zio.http.codec.CodecConfig,zio.http.Status,zio.http.Method,zio.http.Headers,zio.http.Body,java.lang.Object)zio.ZIO
[error]   called from zio.http.codec.internal.EncoderDecoder$Single.decode(zio.http.codec.CodecConfig,zio.http.URL,zio.http.Status,zio.http.Method,zio.http.Headers,zio.http.Body,java.lang.Object)zio.ZIO
[error]   dispatched from zio.http.codec.internal.EncoderDecoder.decode(zio.http.codec.CodecConfig,zio.http.URL,zio.http.Status,zio.http.Method,zio.http.Headers,zio.http.Body,java.lang.Object)zio.ZIO
[error]   called from zio.http.codec.HttpCodec.decodeResponse(zio.http.Response,zio.http.codec.CodecConfig,java.lang.Object)zio.ZIO
[error]   called from private zio.http.endpoint.internal.EndpointClient.execute$$anonfun$1(java.lang.Object,zio.http.Response)zio.ZIO
[error]   called from zio.http.endpoint.internal.EndpointClient.execute(zio.http.ZClient,zio.http.endpoint.Invocation,zio.ZIO,zio.http.codec.Combiner,java.lang.Object)zio.ZIO
[error]   called from private zio.http.endpoint.EndpointExecutor.apply$$anonfun$2(zio.http.endpoint.Invocation,java.lang.Object,zio.http.endpoint.internal.EndpointClient)zio.ZIO
[error]   called from zio.http.endpoint.EndpointExecutor.apply(zio.http.endpoint.Invocation,java.lang.Object)zio.ZIO
[error]   called from private myorg.frontend.PublicServer.loadKeycloakConfig$$anonfun$1()zio.ZIO
[error]   called from myorg.frontend.PublicServer.loadKeycloakConfig()zio.ZIO
[error]   called from myorg.frontend.security.SecurityService$.make(myorg.frontend.PublicServer)zio.ZIO
[error]   called from myorg.frontend.UnauthenticatedPage.init()scala.Tuple2
[error]   dispatched from myorg.frontend.Component.init()scala.Tuple2
[error]   called from myorg.frontend.MainPage.init()scala.Tuple2
[error]   called from myorg.frontend.App$.init(scala.collection.immutable.Map)scala.Tuple2
[error]   dispatched from tyrian.TyrianApp.init(scala.collection.immutable.Map)scala.Tuple2
[error]   called from private tyrian.TyrianApp._init(scala.collection.immutable.Map)scala.Tuple2
[error]   called from tyrian.TyrianApp.ready(org.scalajs.dom.Element,scala.collection.immutable.Map)void
[error]   called from tyrian.TyrianApp.launch(org.scalajs.dom.Element,scala.scalajs.js.Dictionary)void
[error]   called from tyrian.TyrianApp.$js$exported$meth$launch(org.scalajs.dom.Element,scala.scalajs.js.Dictionary)java.lang.Object
[error]   called from myorg.frontend.App$.$js$exported$meth$launch(org.scalajs.dom.Element,scala.scalajs.js.Dictionary)java.lang.Object
[error]   exported to JavaScript with @JSExport
[error] involving instantiated classes:
[error]   zio.http.codec.internal.EncoderDecoder$Single
[error]   zio.http.endpoint.internal.EndpointClient
[error]   zio.http.endpoint.EndpointExecutor
[error]   myorg.frontend.PublicServer
[error]   myorg.frontend.security.SecurityService$
[error]   myorg.frontend.UnauthenticatedPage
[error]   myorg.frontend.MainPage
[error]   myorg.frontend.App$
[error] There were linking errors
[error] (Compile / fastLinkJS) There were linking errors

To Reproduce It needs to try compiling a code using zio-http Endpoint, EndpointLocation and EndpointExecutor with Authentication.Bearer type

Expected behaviour Generated JavaScript should be successfully compiled and should be able to make specified requests

Desktop (please complete the following information):

jdegoes commented 1 month ago

/bounty $125

algora-pbc[bot] commented 1 month ago

πŸ’Ž $125 bounty β€’ ZIO

Steps to solve:

  1. Start working: Comment /attempt #3087 with your implementation plan
  2. Submit work: Create a pull request including /claim #3087 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Thank you for contributing to zio/zio-http!

Add a bounty β€’ Share on socials

Attempt Started (GMT+0) Solution
🟒 @987Nabil Sep 3, 2024, 4:20:54 PM #3090
987Nabil commented 1 month ago

/attempt #3087

Algora profile Completed bounties Tech Active attempts Options
@987Nabil    85 ZIO bounties
+ 1 bounty from 1 project
Scala
Cancel attempt
algora-pbc[bot] commented 1 month ago

πŸ’‘ @987Nabil submitted a pull request that claims the bounty. You can visit your bounty board to reward.

algora-pbc[bot] commented 1 month ago

πŸŽ‰πŸŽˆ @987Nabil has been awarded $125! 🎈🎊