lihaoyi / scala.rx

An experimental library for Functional Reactive Programming in Scala
984 stars 79 forks source link

Uncaught TypeError: undefined is not a function Flow.scala:37 #11

Closed yanns closed 10 years ago

yanns commented 10 years ago

I updated a ScalaJS code to Scala 0.4.1

@JSExport
object HelloWorldExample {

  val model = Var("world")

and I got the following error:

Uncaught TypeError: undefined is not a function Flow.scala:37
ScalaJS.impls.rx_core_Emitter$class__$init$__Lrx_core_Emitter__V Flow.scala:37
ScalaJS.c.rx_core_Var.init___Lscala_Function0__T Core.scala:128
ScalaJS.c.rx_core_Var$.apply__Lscala_Function0__T__Lrx_core_Var Core.scala:109
ScalaJS.c.example_helloworld_HelloWorldExample$.init___ HelloWorldExample.scala:13
ScalaJS.modules.example_helloworld_HelloWorldExample HelloWorldExample.scala:10
(anonymous function)
lihaoyi commented 10 years ago

Are you using the correct version (i.e. "0.2.3-JS") of Scala.Rx? If you are, I can't see what you're doing wrong. I'm personally using Scala.Rx 0.2.3-JS pretty heavily for Scala-Js-Fiddle and if it's something obvious I'd expect to have bumped into it. Could you fork scala-js-example-app to find a minimal repro project?

yanns commented 10 years ago

The problem appears when adding scalajs pickling. With only Scala.rx, it works: https://github.com/yanns/scala-js-example-app/commit/c4bc63d2d262acd270eef892d6a316688d1a8580 Adding scalajs pickling leads to the described error: https://github.com/yanns/scala-js-example-app/commit/d308c3016b5a5883b737984cd1d4e1179aeb8974

lihaoyi commented 10 years ago

That's really weird. Just adding a dependency and not changing anything else is making it break? Are you cleaning between tries just to be sure?

yanns commented 10 years ago

yes, I clean, removed "target"... Very weird. But it has maybe with scala.js to do, not with scala.rx

2014-03-25 11:44 GMT+01:00 Li Haoyi notifications@github.com:

That's really weird. Just adding a dependency and not changing anything else is making it break? Are you cleaning between tries just to be sure?

— Reply to this email directly or view it on GitHubhttps://github.com/lihaoyi/scala.rx/issues/11#issuecomment-38550390 .

lihaoyi commented 10 years ago

Closing this, as doesn't seem scala.rx specific. We can continue on the mailing list =)