question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug in DiffRenderContext

See original GitHub issue

It is triggered by user code, but I think the bug in how diff is rendered. If I use access.transition the failure is silent. access.syncTransition makes the issue clear.

[info] scala.MatchError: 3 (of class java.lang.Byte)
[info]  at levsha.impl.DiffRenderContext.deleteLoop(DiffRenderContext.scala:408)
[info]  at levsha.impl.DiffRenderContext.diff(DiffRenderContext.scala:242)
[info]  at korolev.internal.ApplicationInstance.$anonfun$onState$8(ApplicationInstance.scala:119)
[info]  at korolev.internal.ApplicationInstance.$anonfun$onState$8$adapted(ApplicationInstance.scala:119)
[info]  at korolev.internal.Frontend.$anonfun$performDomChanges$1(Frontend.scala:189)
[info]  at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
[info]  at korolev.effect.Effect$FutureEffect.delay(Effect.scala:78)
[info]  at korolev.effect.Effect$FutureEffect.delay(Effect.scala:66)
[info]  at korolev.internal.Frontend.performDomChanges(Frontend.scala:187)
[info]  at korolev.internal.ApplicationInstance.$anonfun$onState$7(ApplicationInstance.scala:119)
[info]  at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:434)
[info]  at korolev.effect.Effect$FutureEffect$$anon$1.execute(Effect.scala:69)
[info]  at scala.concurrent.impl.Promise$Transformation.submitWithValue(Promise.scala:393)
[info]  at scala.concurrent.impl.Promise$DefaultPromise.submitWithValue(Promise.scala:302)
[info]  at scala.concurrent.impl.Promise$DefaultPromise.dispatchOrAddCallbacks(Promise.scala:276)
[info]  at scala.concurrent.impl.Promise$DefaultPromise.flatMap(Promise.scala:140)
[info]  at korolev.effect.Effect$FutureEffect.flatMap(Effect.scala:86)
[info]  at korolev.effect.Effect$FutureEffect.flatMap(Effect.scala:66)
[info]  at korolev.effect.syntax$EffectOps.flatMap(syntax.scala:36)
[info]  at korolev.internal.ApplicationInstance.$anonfun$onState$5(ApplicationInstance.scala:108)
[info]  at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:434)
[info]  at korolev.effect.Effect$FutureEffect$$anon$1.execute(Effect.scala:69)
[info]  at scala.concurrent.impl.Promise$Transformation.submitWithValue(Promise.scala:393)
[info]  at scala.concurrent.impl.Promise$DefaultPromise.submitWithValue(Promise.scala:302)
[info]  at scala.concurrent.impl.Promise$DefaultPromise.dispatchOrAddCallbacks(Promise.scala:276)
[info]  at scala.concurrent.impl.Promise$DefaultPromise.flatMap(Promise.scala:140)
[info]  at korolev.effect.Effect$FutureEffect.flatMap(Effect.scala:86)
[info]  at korolev.effect.Effect$FutureEffect.flatMap(Effect.scala:66)
[info]  at korolev.effect.syntax$EffectOps.flatMap(syntax.scala:36)
[info]  at korolev.internal.ApplicationInstance.$anonfun$onState$1(ApplicationInstance.scala:105)
[info]  at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:434)
[info]  at korolev.effect.Effect$FutureEffect$$anon$1.execute(Effect.scala:69)
[info]  at scala.concurrent.impl.Promise$Transformation.submitWithValue(Promise.scala:393)
[info]  at scala.concurrent.impl.Promise$DefaultPromise.submitWithValue(Promise.scala:302)
[info]  at scala.concurrent.impl.Promise$DefaultPromise.dispatchOrAddCallbacks(Promise.scala:276)
[info]  at scala.concurrent.impl.Promise$DefaultPromise.flatMap(Promise.scala:140)
[info]  at korolev.effect.Effect$FutureEffect.flatMap(Effect.scala:86)
[info]  at korolev.effect.Effect$FutureEffect.flatMap(Effect.scala:66)
[info]  at korolev.effect.syntax$EffectOps.flatMap(syntax.scala:36)
[info]  at korolev.internal.ApplicationInstance.onState(ApplicationInstance.scala:103)
[info]  at korolev.internal.ApplicationInstance.$anonfun$topLevelComponentInstance$2(ApplicationInstance.scala:84)
[info]  at korolev.internal.ComponentInstance.$anonfun$applyTransition$4(ComponentInstance.scala:280)
[info]  at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:434)
[info]  at korolev.effect.Effect$FutureEffect$$anon$1.execute(Effect.scala:69)
[info]  at scala.concurrent.impl.Promise$Transformation.submitWithValue(Promise.scala:393)
[info]  at scala.concurrent.impl.Promise$DefaultPromise.submitWithValue(Promise.scala:302)
[info]  at scala.concurrent.impl.Promise$DefaultPromise.dispatchOrAddCallbacks(Promise.scala:276)
[info]  at scala.concurrent.impl.Promise$DefaultPromise.flatMap(Promise.scala:140)
[info]  at korolev.effect.Effect$FutureEffect.flatMap(Effect.scala:86)
[info]  at korolev.effect.Effect$FutureEffect.flatMap(Effect.scala:66)
[info]  at korolev.effect.syntax$EffectOps.flatMap(syntax.scala:36)
[info]  at korolev.internal.ComponentInstance.$anonfun$applyTransition$2(ComponentInstance.scala:279)
[info]  at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:434)
[info]  at korolev.effect.Effect$FutureEffect$$anon$1.execute(Effect.scala:69)
[info]  at scala.concurrent.impl.Promise$Transformation.submitWithValue(Promise.scala:393)
[info]  at scala.concurrent.impl.Promise$DefaultPromise.submitWithValue(Promise.scala:302)
[info]  at scala.concurrent.impl.Promise$DefaultPromise.dispatchOrAddCallbacks(Promise.scala:276)
[info]  at scala.concurrent.impl.Promise$DefaultPromise.flatMap(Promise.scala:140)
[info]  at korolev.effect.Effect$FutureEffect.flatMap(Effect.scala:86)
[info]  at korolev.effect.Effect$FutureEffect.flatMap(Effect.scala:66)
[info]  at korolev.effect.syntax$EffectOps.flatMap(syntax.scala:36)
[info]  at korolev.internal.ComponentInstance.$anonfun$applyTransition$1(ComponentInstance.scala:277)
[info]  at korolev.internal.ComponentInstance.applyTransition(ComponentInstance.scala:282)
[info]  at korolev.internal.ComponentInstance$browserAccess$.syncTransition(ComponentInstance.scala:140)
[info]  at com.nt.front.UiWebService.$anonfun$config$433(UiWebService.scala:2793)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
fomkincommented, May 29, 2021

The problem was partially fixed in Levsha 1.0.0. Now if tag content couldn’t be sorted during optimization it will be leaved unoptimized. However you can force optimization for these cases if you want. See optimizer options.

1reaction
fomkincommented, Apr 25, 2021

It’s known problem. If levsha.macros.unableToSortTagWarnings sys property is true, you will get warning about this. Unfortunately I never added it to documentation. Try:

select(id := "dropdown-list",
  option(value := "choice1", if (true) selected else void, "Cat"),
  option(value := "choice2", if (false) selected else void, "Dog"),
  selectorId
)

Also you can use when as shortcut for if (cond) node else void.

Read more comments on GitHub >

github_iconTop Results From Across the Web

fomkin/korolev - Gitter
I think there is a bug somewhere. ... as I said, i think this is a bug in optimizer. ... <init>(DiffRenderContext.scala:65) [error] at...
Read more >
[visualization] possible bug: in visualizer, point clouds' positions are ...
Describe the bug. In visualizer, point clouds' positions are not correct. Context. Just trying to show two point clouds in pcl visualizer, ...
Read more >
fomkin ( Aleksey Fomkin ) - github record :)
I assume they are bugs. I've constructed minimal examples for both ... openNode(DiffRenderContext.scala:101) [info] at korolev.server.internal.services.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found