Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7560451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:54:20+00:00 2026-05-30T12:54:20+00:00

Zombie: Cannot read property ‘compareDocumentPosition’ of null TypeError: Cannot read property ‘compareDocumentPosition’ of null

  • 0

Zombie: Cannot read property ‘compareDocumentPosition’ of null TypeError: Cannot read property ‘compareDocumentPosition’
of null

This happens any time I try to load a page that includes jQuery using Zombiejs. This has happened to me on Debian & Windows, with a variety of different pages, using different versions of jQuery and with nothing else on the page.

It seems to have something to do with the way jsDom evaluates jQuery before the page document is ready, but it’s pretty far over my head.

Anyone run into this, know a workaround, or have any pointers? Thanks!

UPDATE: This is my test (which actually passes, but running with debug shows the error I mentioned):

zombie = require "zombie"
browser = new zombie.Browser({debug: false})
$ = require "jquery"
require "should"    

app = "http://localhost:3000/"

describe "app", ->
  describe "index", ->
    it "should display correct title", (done) ->
      browser.visit app, (err, browser) ->
        done()

And this is the error:

Zombie: GET http://localhost:3000/js/jquery-1.7.1.js => 200 Zombie: Cannot read property 'compareDocumentPosition' of null TypeError: Cannot read property 'compareDocumentPosition' of null
    at Object.<anonymous> (/js/jquery-1.7.1.js:4807:30)
    at Object.<anonymous> (/js/jquery-1.7.1.js:5301:2)
    at Object.<anonymous> (/js/jquery-1.7.1.js:9266:2)
    at Object._evaluate (/home/dev/Hg/rpg-chat-bdd/node_modules/zombie/lib/zombie/browser.js:136:28)
    in /js/jquery-1.7.1.js

which causes a other errors because ‘$’ is not defined in the rest of my scripts.

This is the HTML of the page I’m testing:

<title>Welcome to Test!</title>

<body>
  <div id="main">
  </div>

  <script type="text/javascript" src="/js/jquery-1.7.1.js"></script>
  <script type="text/javascript" src="/js/application.js"></script>
</body>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T12:54:21+00:00Added an answer on May 30, 2026 at 12:54 pm

    this is a shot in the dark, but i cloned https://github.com/assaf/zombie.git and grepped for compareDocumentPosition. The first line(s) found in the files are like this:

    if ( document.documentElement.compareDocumentPosition ) {
    

    Now, document.documentElement usually points to the <html>-tag, are you maybe missing that?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to increase BrainsEaten each time any instance of Zombie executes EatBrains. How
Happy Friday. Having an interesting time debugging a zombie issue. I have a UITableView
I have spent hours on this and read everybit on the web about memory
I have an xml file that looks like this: <!DOCTYPE ROOT SYSTEM zombie.dtd> <ROOT>
So I came across zombie.js, is this a headless browser? If so, what browser
kill -s SIGCHLD The above is the code for killing any zombie process, But
I found this paint app and used the Profile/Zombie instrument on it. Apparently the
So basically I would like my app to read info from a database, this
I'm trying to find a way to remove zombie locks using the Subversion command
I am trying to get get zombie.js to activate a link that uses javascript.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.