question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: cheerio is not a function

See original GitHub issue

I’m trying out spectaql (0.2.0) for the first time, and I’m hitting the following error:

$ npx spectaql docs/spectaql.yml

COULD NOT LOAD EXAMPLE PROCESSOR

Running "sass:full" (sass) task

Running "sass:foundation" (sass) task

Running "concat:css" (concat) task

Running "cssmin:css" (cssmin) task
>> 1 file created. 140.88 kB → 121.62 kB

Running "concat:js" (concat) task

Running "uglify:js" (uglify) task
>> 1 file created 6.82 kB → 3 kB

Running "clean:html" (clean) task
>> 0 paths cleaned.

Running "compile-handlebars:compile" (compile-handlebars) task
Task error: [TypeError: cheerio is not a function
  at Object.markdown (/Users/trobinson/fittfinder/fittfinder-service/node_modules/spectaql/app/lib/common.js:84:15)

I tried running npm i -D cheerio, but got the same error. I’m running against a schema file:

introspection:
  schemaFile: ./dist/schema.graphql

servers:
  - url: https://example.com/graphql
    description: Production
    production: true

I tried with a trivial schema too, and got the same error:

schema {
  query: Query
}

type Query {
  test: Int
}

node/npm/OS version:

$ node -v
v12.18.4
$ npm -v
6.14.6
$ uname -v
Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
newhousecommented, May 12, 2021

@newhouse When should we expect this to arrive on NPM?

Fix is in 0.2.1 available now. @benhickson

1reaction
trevorrcommented, May 12, 2021

Thanks @newhouse, can’t wait to try it out! Also, you’re a towel. 😂

Read more comments on GitHub >

github_iconTop Results From Across the Web

Task error: [TypeError: cheerio is not a function #36 - GitHub
it appears that the function cheerio() as defined in /usr/local/lib/node_modules/dociql/app/lib/common.js does not seem to have compatible ...
Read more >
"TypeError: $ is not a function" when trying to use cheerio like ...
I know cheerio is installed and works as I have declared it with "const $ = require('cheerio');" and have been able to use...
Read more >
Cheerio is not a function | Error Fixed | 100% Working | NPM
Hello, if you are getting cheerio is not a function error while using NPM then worry not, in this video I will show...
Read more >
Having trouble $(...).each is not a function : r/javascript - Reddit
I'am doing something wrong ? My code: const fetch = require('node-fetch') const cheerio = require('cheerio') const getTravianTime = async ...
Read more >
How to use not function in Cheerio - Tabnine
$elements .not((i, elem) => IGNORE_SELECTORS.some((selector) => $(elem).is(selector))) .each((i, elem) => { if (summary.length > SUMMARY_MAX_LENGTH) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found