Hyper445
Hyper445

Reputation: 31

Not rendering Salix's counter example

Using the example given in Salix's github, I've been unable to correctly render the counter app.

I have used the code provided to create the view, update and init functions. Then I have created the app using the following function.

SalixApp[Model] counterApp(str appId = "counterApp") = makeApp(appId, init, view, update);

and created the web application using

App[Model] counterWebApp() 
      = webApp(counterApp(), |file:///.../index.html|, |file:///...|); 

Also, I have used the necessary scripts in the HTML file.

Some other things: I have, as far as I know, updated the correct paths, and the appId, the string in the new Salix("") function, and the div id are all the same.

Yet, when I run the counterWebApp, it renders a blank page and gives me the following error message:

Uncaught TypeError: Cannot read properties of undefined (reading 'edits')
    at patchDOM (salix.js:257:30)
    at render (salix.js:84:3)
    at Object.step [as success] (salix.js:73:3)
    at j (jquery-1.11.0.min.js:2:27136)
    at Object.fireWith [as resolveWith] (jquery-1.11.0.min.js:2:27949)
    at x (jquery-1.11.0.min.js:4:22244)
    at XMLHttpRequest.b (jquery-1.11.0.min.js:4:26298)

Going to http://localhost:9051/counterApp/init shows me the all the HTML elements I've defined in the view function.

What am I doing wrong?

What I tried and what I was expecting is mentioned in the post above.

Upvotes: 1

Views: 29

Answers (1)

Jurgen Vinju
Jurgen Vinju

Reputation: 6696

The salix project was deprecated for salix-core here: https://github.com/usethesource/salix-core

Please have a look at the examples there. Salix-core is much more up-to-date and we intend to build on top of that.

There is also https://github.com/usethesource/salix-contrib, with salix bindings for ACE, charts, mermaid, etc.

Upvotes: 1

Related Questions