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

TypeError: container.querySelectorAll is not a function #20

Open
SirkoS opened this issue Feb 2, 2021 · 0 comments
Open

TypeError: container.querySelectorAll is not a function #20

SirkoS opened this issue Feb 2, 2021 · 0 comments

Comments

@SirkoS
Copy link

SirkoS commented Feb 2, 2021

I get the above error when I try to run the plugin even with a minimal setup like this

index.htm

<section data-external="slides/01-motivation.htm"></section>

slides/01-motivation.htm

<h3>What's the problem?</h3>
<div>
  <img src="./../gfx/someImage.jpg" />
</div>

The same effect happens using data-external-replace and an included file like this (with a trailing line break, that somewhat is cut by github):

<section>
  <h3>What's the problem?</h3>
  <div>
    <img src="./../gfx/someImage.jpg" />
  </div>
</section>

The full stack trace looks like this

Uncaught TypeError: container.querySelectorAll is not a function
    convertAttributes [...]/node_modules/reveal_external/external/external.js:72
    convertUrls [...]/node_modules/reveal_external/external/external.js:89
    onreadystatechange [...]/node_modules/reveal_external/external/external.js:123
    updateSection [...]/node_modules/reveal_external/external/external.js:155
    loadExternal [...]/node_modules/reveal_external/external/external.js:188
    <anonymous> [...]/node_modules/reveal_external/external/external.js:194
    <anonymous> [...]/node_modules/reveal_external/external/external.js:195

I checked the code and it seems the issue is caused by text-nodes being passed to convertUrls(). A quick fix would be to change line 122 to the following:

if( nodes[i] instanceof HTMLElement ) {
  convertUrls( nodes[i], path );
}
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

1 participant