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

Code in ReadMe.md failed for unkonow reason. #490

Closed
djx314 opened this issue Mar 9, 2023 · 8 comments
Closed

Code in ReadMe.md failed for unkonow reason. #490

djx314 opened this issue Mar 9, 2023 · 8 comments

Comments

@djx314
Copy link
Contributor

djx314 commented Mar 9, 2023

Code Link

Dependencies:

libraryDependencies += "com.yang-bo"              %%% "html"    % "3.0.2"
libraryDependencies += "com.thoughtworks.binding" %%% "binding" % "12.2.0"

Plugins:

addSbtPlugin("org.scala-js"                      % "sbt-scalajs"              % "1.13.0")
addSbtPlugin("com.vmunier"                       % "sbt-web-scalajs"          % "1.2.0")
addSbtPlugin("com.typesafe.sbt"                  % "sbt-js-engine"            % "1.2.3")
addSbtPlugin("com.thoughtworks.sbt-scala-js-map" % "sbt-scala-js-map"         % "4.1.1")

Scala Version: 3.2.2

Message:

sbt:desu-video> prun
[info] scalafmt: Formatting 2 Scala sources (Path\desu-video\frontend\js)...
[info] scalafmt: Formatting 1 Scala sources (Path\desu-video\frontend\js)...
[info] scalafmt: Reformatted 1 Scala sources
[info] compiling 2 Scala sources to Path\desu-video\frontend\js\target\scala-3.2.2\classes ...
[error] -- [E007] Type Mismatch Error: Path\desu-video\frontend\js\src\main\scala\AA.scala:56:4 
[error] 56 |    html"""<tr>
[error]    |    ^
[error]    |Found:    com.thoughtworks.binding.Binding.BindingSeq[org.scalajs.dom.Node]
[error]    |Required: com.thoughtworks.binding.Binding[org.scalajs.dom.html.TableRow]
[error] 57 |      <td>${contact.name.bind}</td>
[error] 58 |      <td>${contact.email.bind}</td>
[error] 59 |      <td>${bindingButton(contact).bind}</td>
[error] 60 |    </tr>"""
[error]    |
[error]    | longer explanation available when compiling with `-explain`
[error] one error found
[info] scalafmt: Formatting 1 Scala sources (Path\desu-video\backend\desu-video-common)...
[error] (frontendJS / Compile / compileIncremental) Compilation failed
[error] Total time: 10 s, completed 2023-3-9 8:58:05
@Atry
Copy link
Collaborator

Atry commented Mar 9, 2023

Would it work if you delete the return type like adf7ec7

@djx314
Copy link
Contributor Author

djx314 commented Mar 9, 2023

emmm, it seems that it makes bindingTr as a BindingSeq and not a Binding[Node]

sbt:desu-video> 
sbt:desu-video> 
sbt:desu-video> frontendJS/clean
[success] Total time: 0 s, completed 2023-3-9 17:52:13
sbt:desu-video> 
sbt:desu-video> 
sbt:desu-video> prun
[info] scalafmt: Formatting 2 Scala sources (E:\programming\workspace\desu-video\frontend\js)...
[info] scalafmt: Formatting 2 Scala sources (E:\programming\workspace\desu-video\frontend\js)...
[info] compiling 2 Scala sources to E:\programming\workspace\desu-video\frontend\js\target\scala-3.2.2\classes ...
[error] -- [E008] Not Found Error: E:\programming\workspace\desu-video\frontend\js\src\main\scala\AA.scala:67:27 
[error] 67 |        bindingTr(contact).bind
[error]    |        ^^^^^^^^^^^^^^^^^^^^^^^
[error]    |value bind is not a member of com.thoughtworks.binding.Binding.BindingSeq[org.scalajs.dom.Node].
[error]    |An extension method was tried, but could not be fully constructed:
[error]    |
[error]    |    com.thoughtworks.dsl.Dsl.shift[com.thoughtworks.binding.Binding.Bind[Any], Any](
[error]    |      com.thoughtworks.binding.Binding.Bind[Any](DummyImplicit.dummyImplicit).apply(
[error]    |        AA.bindingTr(contact)
[error]    |      )
[error]    |    )
[error] -- Error: E:\programming\workspace\desu-video\frontend\js\src\main\scala\AA.scala:64:4 
[error]  64 |    html"""<table>
[error]     |    ^
[error]     |Require a HTML DOM expression, got interpolation expression com.thoughtworks.binding.Binding.BindingSeq[scala.Any]
[error]     |method watchableBindableSeq in trait LowPriorityBindableSeq2 does not match type com.thoughtworks.binding.bindable.BindableSeq.Lt[Value, org.scalajs.dom.Node]
[error]  65 |      <tbody>
[error]  66 |        ${for (contact <- contacts) yield {
[error]  67 |        bindingTr(contact).bind
[error]  68 |      }}
[error]  69 |      </tbody>
[error]  70 |    </table>"""
[error]     |---------------------------------------------------------------------------
[error]     |Inline stack trace
[error]     |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[error]     |This location contains code that was inlined from Reset.scala:113
[error]      ---------------------------------------------------------------------------
[error] two errors found
[info] scalafmt: Formatting 1 Scala sources (E:\programming\workspace\desu-video\backend\desu-video-common)...
[error] (frontendJS / Compile / compileIncremental) Compilation failed
[error] Total time: 4 s, completed 2023-3-9 17:52:19
sbt:desu-video> 

@djx314
Copy link
Contributor Author

djx314 commented Mar 9, 2023

Code

@Atry
Copy link
Collaborator

Atry commented Mar 9, 2023

How about 21c86d8?

@djx314
Copy link
Contributor Author

djx314 commented Mar 9, 2023

The same error. And change to this, it works, but the HTML seems not right.

图片

It seems that all the is miss and just add some Text Snippet to HTML, so I think the type BindingSeq[Node] means Binding[Seq[TextNode]].

@djx314
Copy link
Contributor Author

djx314 commented Mar 10, 2023

Code

Eager fix the problem in sbt-depts and now can reproduct the problem by run

sbt>frontendJS/compile

@djx314
Copy link
Contributor Author

djx314 commented Mar 10, 2023

The same error. And change to this, it works, but the HTML seems not right.

图片

It seems that all the is miss and just add some Text Snippet to HTML, so I think the type BindingSeq[Node] means Binding[Seq[TextNode]].

Error typo.

It seems that all the is miss and just add some Text Snippet to HTML, so I think the type BindingSeq[Node] means Binding[Seq[TextNode]].

It seems that all the HTML Tags is miss and just add some Text Snippet to HTML, so I think the type BindingSeq[Node] means Binding[Seq[TextNode]].

@Atry Atry closed this as completed Apr 30, 2023
@Atry
Copy link
Collaborator

Atry commented Apr 30, 2023

Fixed in Atry/html.scala@d627afe

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

2 participants