Giter VIP home page Giter VIP logo

Comments (4)

terminalcommand avatar terminalcommand commented on July 30, 2024 1

Hello, same error happens to me on Firefox 56 on Lubuntu 17.10.

After I run M-x run-skewer and switch to skewer-repl, any command I type and send causes this error.

I've set up chromium as my browser and tried it again, it gives an error on the same line, but the error message is more explanatory.

Failed to load resource: the server responded with a status of 404 (Not Found)
skewer:212 Uncaught DOMException: Failed to execute 'querySelector' on 'Document': The provided selector is empty.
at query (http://127.0.0.1:8080/skewer:212:25)
at Object.skewer.fn.html (http://127.0.0.1:8080/skewer:220:18)
at callback (http://127.0.0.1:8080/skewer:14:45)
at XMLHttpRequest.xhr.onreadystatechange (http://127.0.0.1:8080/skewer:40:13)

The function that gives the error is:
function query(ancestry) { return document.querySelector(buildSelector(ancestry)); // this line is problematic }

buildSelector(ancestry) returns empty, and therefore document.querySelector(nil) fails.

I installed skewer directly from melpa.

I'd be happy to provide more information.

from skewer-mode.

skeeto avatar skeeto commented on July 30, 2024

from skewer-mode.

Ruin0x11 avatar Ruin0x11 commented on July 30, 2024

Happens to me also. Running the demo included with skewer fails with the same message. I used Chrome 65 on Windows 7.

Uncaught DOMException: Failed to execute 'querySelector' on 'Document': The provided selector is empty.
    at query (http://127.0.0.1:8080/skewer:212:25)
    at Object.skewer.fn.html (http://127.0.0.1:8080/skewer:220:18)
    at callback (http://127.0.0.1:8080/skewer:14:45)
    at XMLHttpRequest.xhr.onreadystatechange (http://127.0.0.1:8080/skewer:40:13)

It seems to try evaluating the top-level HTML tag on startup but fails because the ancestry list is null, which ends up creating a blank CSS selector. But the blank ancestry list is created in Emacs as well when I evaluate skewer-html-compute-tag-ancestry on the top level tag.

As a workaround I modified skewer-html-compute-tag-ancestry as follows:

(defun skewer-html-compute-tag-ancestry ()
  "Compute the ancestry chain at point."
  (skewer-html--with-html-mode
    (nreverse
     (cl-loop for tag in (skewer-html--get-context)
              for nth = (skewer-html-compute-tag-nth (1+ (sgml-tag-start tag)))
              for name = (skewer-html--cleanup tag)
              ;;unless (equal name "html")
              collect (list name nth)))))

This way an html tag will always be included in the ancestry. Then everything works swimmingly.

from skewer-mode.

vlnn avatar vlnn commented on July 30, 2024

So.. any progress on this? The problem is still there as far as I see. @skeeto do you think the solution provided by @Ruin0x11 is good enough to be merged?

from skewer-mode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.