Skip to content

not work #24

@zhaojiedi1992

Description

@zhaojiedi1992

Describe the bug

context
When I do ___.
Uncaught TypeError: Cannot read properties of undefined (reading 'appendChild')
at HTMLDocument.addUtterances (000-开服简介.html:49:17)

expectation
I expected ___ to occur.
Uncaught TypeError: Cannot read properties of undefined (reading 'appendChild')
at HTMLDocument.addUtterances (000-开服简介.html:49:17)

var addUtterances = () => {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "https://utteranc.es/client.js";
script.async = "async";

script.setAttribute("repo", "zhaojiedi1992/My_Study_MC");
script.setAttribute("issue-term", "pathname");
script.setAttribute("theme", "github-light");
script.setAttribute("label", "💬 comment");
script.setAttribute("crossorigin", "anonymous");

sections = document.querySelectorAll("div.section");
if (sections !== null) {
    section = sections[sections.length-1];   
    section.appendChild(script);   //error here 
}

}

bug
But instead ___ happens
Here's an error message I ran into...

$ jupyter-book build mybook
ERROR ...

problem
This is a problem for people doing ___ because ___.

Reproduce the bug

my conf
comments_config = {
"utterances": {
"repo": "zhaojiedi1992/My_Study_MC",
"issue-term": "pathname",
"theme": "github-light",
"crossorigin": "anonymous" ,
}
}

List your environment

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions