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.

ERROR operatorPackage[operator] is not a function

See original GitHub issue

Version

@nuxt/content: v1.9.0 nuxt: v2.14.7

Reproduction Link

https://github.com/sandoche/CuratedStack-nocode-template/tree/issue-nuxt-content

Steps to reproduce

  1. Clone https://github.com/sandoche/CuratedStack-nocode-template
  2. Go to branch issue-nuxt-content
  3. Run npm run dev
  4. Click on ‘Open source’ or ‘Productivity’

What is Expected?

To load the content.

What is actually happening?

 ERROR  operatorPackage[operator] is not a function                                                           18:37:38

  at result_set_ResultSet.find (node_modules\@lokidb\loki\lokidb.loki.js:1418:50)
  at QueryBuilder.where (node_modules\@nuxt\content\lib\query-builder.js:73:29)
  at node_modules\@nuxt\content\lib\middleware.js:107:19

Note that when you open the page in a new tab it does work. But when you click direcly it does not and give this error.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

14reactions
AlexanderBelokoncommented, Dec 20, 2020

I’ve reproduced your issue and the problem is in your property name categories_slugs. Underscore has special meaning in nuxt/content’s .where() and it misunderstands your intention. If you rename categories_slugs to anything without underscores, the problem goes away.

2reactions
ldrummondcommented, Apr 8, 2021

Is this still an issue? Are you basically not able to use underscore characters in keys? Some CMS systems by default use underscore separated (snake case) keys for fields. If you can’t use .where() to parse values with an underscore, that seems like a bug or worth mentioning in the docs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SML - Error: operator is not a function [tycon mismatch]
But I'm getting an error on sumDigits (factLarge 100) and I don't know how to fix it. 20.sml:8.19-11.26 Error: operator is not a...
Read more >
TypeError: "x" is not a function - JavaScript - MDN Web Docs
The JavaScript exception "is not a function" occurs when there was an attempt to call a value from a function, but the value...
Read more >
11 Debugging | Modern Statistics with R
If a function returns an error, it is not always clear where exactly the error occurred. Let's say that we want to compute...
Read more >
Never use the Dot operator in JavaScript, for Data
Perhaps you're playing with some home automation script, and you type out a helper function for some data structure, like below. You know...
Read more >
The Go Programming Language Specification
The text is not canonicalized, so a single accented code point is distinct ... There are four classes: identifiers, keywords, operators and ...
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