parser: TypeError: $ is not a function

  • Platform: Darwin Mac-Pro.local 18.2.0 Darwin Kernel Version 18.2.0: Thu Dec 20 20:46:53 PST 2018; root:xnu-4903.241.1~1/RELEASE_X86_64 x86_64

    Linux rss 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 x86_64 x86_64 GNU/Linux

  • Mercury Parser Version: Latest. Installed with yarn global add @postlight/mercury-parser

  • Node Version (if a Node bug): v11.10.0 (I don’t think this is a node bug)

    Also shows in serverless

  • Browser Version (if a browser bug): n.a.

Expected Behavior

A parsed page and not an error

Current Behavior

$ mercury-parser https://tweakers.net/nieuws/149154/nederlandse-supercomputerbouwer-clustervision-is-failliet.html

Mercury Parser encountered a problem trying to parse that resource.

TypeError: $ is not a function
    at /Users/fred/.config/yarn/global/node_modules/@postlight/mercury-parser/dist/mercury.js:6079:12
    at Array.find (<anonymous>)
    at detectByHtml (/Users/fred/.config/yarn/global/node_modules/@postlight/mercury-parser/dist/mercury.js:6078:46)
    at getExtractor (/Users/fred/.config/yarn/global/node_modules/@postlight/mercury-parser/dist/mercury.js:6090:60)
    at Object._callee$ (/Users/fred/.config/yarn/global/node_modules/@postlight/mercury-parser/dist/mercury.js:6458:27)
    at tryCatch (/Users/fred/.config/yarn/global/node_modules/regenerator-runtime/runtime.js:62:40)
    at Generator.invoke [as _invoke] (/Users/fred/.config/yarn/global/node_modules/regenerator-runtime/runtime.js:288:22)
    at Generator.prototype.(anonymous function) [as next] (/Users/fred/.config/yarn/global/node_modules/regenerator-runtime/runtime.js:114:21)
    at asyncGeneratorStep (/Users/fred/.config/yarn/global/node_modules/@babel/runtime-corejs2/helpers/asyncToGenerator.js:5:24)
    at _next (/Users/fred/.config/yarn/global/node_modules/@babel/runtime-corejs2/helpers/asyncToGenerator.js:27:9)

If you believe this was an error, please file an issue at:

    https://github.com/postlight/mercury-parser/issues/new

Steps to Reproduce

mercury-parser https://tweakers.net/nieuws/149154/nederlandse-supercomputerbouwer-clustervision-is-failliet.html

Also in API

Not certain if this is helpful or not. This problem also happens when using the API variant of mercury. As far as I know pages from this site DID work for the online version.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 41 (19 by maintainers)

Most upvoted comments

The change for returning more specific errors on failed parse attempts has been merged into master and will be included in the next release.