https://htmx.org logo
Join Discord
Powered by
# πŸ”₯-django-htmx
  • m

    mysterious-toddler-20573

    12/01/2022, 12:54 PM
    that will help
  • q

    quiet-action-5563

    12/01/2022, 12:57 PM
    Already switched to non-minified, without the spinner the error is exactly the same.
  • m

    mysterious-toddler-20573

    12/01/2022, 1:00 PM
    Ah, OK
  • m

    mysterious-toddler-20573

    12/01/2022, 1:00 PM
    this is happening when the new content has a script in it
  • m

    mysterious-toddler-20573

    12/01/2022, 1:00 PM
    can we see what the response looks like?
  • m

    mysterious-toddler-20573

    12/01/2022, 1:00 PM
    the actual HTML?
  • q

    quiet-action-5563

    12/01/2022, 1:01 PM
    Sure, the content returned by the endpoint is pure JS (the chart itself):
  • q

    quiet-action-5563

    12/01/2022, 1:01 PM
    var is2Chart=echarts.init(document.getElementById('is2Chart'));if(is2Chart){var is2Chart_option={title:{text:'GΓͺnero',left:'center'},legend:{show:true,bottom:10,left:'center'},tooltip:{trigger:'item'},series:[{type:'pie',label:{show:true,formatter:'{c} ({d}%)',position:'outside'},data:[{'name':'Masculino','value':1},{'name':'Feminino','value':3},{'name':'Outro','value':1}],radius:'50%'}]};is2Chart.setOption(is2Chart_option)}
  • m

    mysterious-toddler-20573

    12/01/2022, 1:03 PM
    Can you execute that code directly in the console and see if there are any errors?
  • q

    quiet-action-5563

    12/01/2022, 1:05 PM
    Mmm ... in the JS console ? It's a Django app, the code is executed in Python, in the HTML I have only the div that I posted and the
  • q

    quiet-action-5563

    12/01/2022, 1:06 PM
    It seems that everything is working (charts are displayed), but I don't like the HTMX error!
  • m

    mysterious-toddler-20573

    12/01/2022, 1:09 PM
    i agree
  • m

    mysterious-toddler-20573

    12/01/2022, 1:09 PM
    we need to get to the bottom of it
  • q

    quiet-action-5563

    12/01/2022, 1:09 PM
    eCharts just added to the div the _echarts_instance_
  • m

    mysterious-toddler-20573

    12/01/2022, 1:12 PM
    can you wrap that code in this:
    Copy code
    js
    try {
       ... YOUR CODE
    } catch (error) {
      console.trace();
      console.error(error);
    }
  • q

    quiet-action-5563

    12/01/2022, 1:17 PM
    Done, nothing happened; if I change the data, the chart is correctly updated with the new data
  • q

    quiet-action-5563

    12/01/2022, 1:18 PM
    Do you want me to put a breakpoint in HTMX code to see what happens?
  • q

    quiet-action-5563

    12/01/2022, 1:19 PM
    I am using the latest version
  • m

    mysterious-toddler-20573

    12/01/2022, 1:20 PM
    if you are comfortable debugging it, yes, that would be great
  • m

    mysterious-toddler-20573

    12/01/2022, 1:22 PM
    https://github.com/bigskysoftware/htmx/blob/master/src/htmx.js#L1744
  • m

    mysterious-toddler-20573

    12/01/2022, 1:22 PM
    this is probably the line in question
  • m

    mysterious-toddler-20573

    12/01/2022, 1:22 PM
    I wonder if eCharts removes the script node it is in
  • q

    quiet-action-5563

    12/01/2022, 1:27 PM
    Yes, it pauses on this breakpoint that for me is line 1730, and gives the error; do you want to see some variables ?
  • q

    quiet-action-5563

    12/01/2022, 1:29 PM
    And then if I continue, it throws the error
  • m

    mysterious-toddler-20573

    12/01/2022, 1:32 PM
    what is
    script.parentNode
    ?
  • m

    mysterious-toddler-20573

    12/01/2022, 1:34 PM
    It seems like eCharts is removing the script node from the DOM
  • q

    quiet-action-5563

    12/01/2022, 1:35 PM
    It's null!
  • m

    mysterious-toddler-20573

    12/01/2022, 1:35 PM
    ok
  • m

    mysterious-toddler-20573

    12/01/2022, 1:35 PM
    eCharts
  • m

    mysterious-toddler-20573

    12/01/2022, 1:35 PM
    why u do
1...848586...100Latest