Skip to content

document.querySelector error #29

@bgbruno

Description

@bgbruno

Hello - I run

const qselector = require('qselector/dist/cjs');
console.log(qselector.$(body, 'p'));

and I get error

/node_modules/qselector/dist/cjs/index.js:42
    var root = document.querySelector(el || '');
               ^

ReferenceError: document is not defined
    at core (/node_modules/qselector/dist/cjs/index.js:42:16)
    at Object.$ (/node_modules/qselector/dist/cjs/index.js:54:42)
    at Request._callback (/index.njs:85:31)
    at Request.self.callback (/node_modules/request/request.js:185:22)
    at Request.emit (events.js:182:13)
    at Request.<anonymous> (/node_modules/request/request.js:1161:10)
    at Request.emit (events.js:182:13)
    at IncomingMessage.<anonymous> (/node_modules/request/request.js:1083:12)
    at Object.onceWrapper (events.js:273:13)
    at IncomingMessage.emit (events.js:187:15)

Q can you help?

Bruno

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions