Home  >  Q&A  >  body text

Counterexample to not rendering Salix

<p>Using the example provided by Salix on GitHub, I am unable to render the counter application correctly. </p><p>I have created the view, update, and initialization functions using the code provided. Then I created the application using the following function. </p><p><br /></p> <pre class="brush:php;toolbar:false;">SalixApp[Model] counterApp(str appId = "counterApp") = makeApp(appId, init, view, update);</pre> <p>And created a web application using... </p> <pre class="brush:php;toolbar:false;">App[Model] counterWebApp() = webApp(counterApp(), |file:///.../index.html|, |file:///...|);</pre> <p>Also, I used the necessary scripts in the HTML file. </p><p>A few other things: As far as I know, I've updated the correct path, the appId, the string in the new Salix("") function, and the div id are all the same. </p><p>However, when I run counterWebApp, it renders a blank page and gives the following error message: </p><p><br /></p> ; <pre class="brush:php;toolbar:false;">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)</pre> <p>Visiting http://localhost:9051/counterApp/init displays all the HTML elements I defined in the view function. </p><p>What did I do wrong? </p><p>What I tried and the results I expected are mentioned in the above post. </p><p><br /></p>
P粉006977956P粉006977956473 days ago569

reply all(1)I'll reply

  • P粉210405394

    P粉2104053942023-07-28 17:10:38

    The Salix project has been deprecated and is now replaced by salix-core. The URL is here: https://github.com/usethesource/salix-core

    Please see the examples there. Salix-core is newer and we intend to build on it.

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

    reply
    0
  • Cancelreply