Content: value.split is not a function

Created on 22 May 2020  路  7Comments  路  Source: nuxt/content

After initial install, I'm getting this error:

  at analyzer_StandardAnalyzer.whitespaceTokenizer [as tokenizer] (node_modules/@lokidb/full-text-search/lokidb.full-text-search.js:139:18)
  at analyze (node_modules/@lokidb/full-text-search/lokidb.full-text-search.js:175:29)
bug

Most helpful comment

Just a quick note, as I still ran into this while starting over -- if you get this error, it's likely you have an issue with YAML frontmatter. I had one file like this:

---
title: 300
---

And the module didn't like that, until I did this:

---
title: '300'
---

Hope that helps!

All 7 comments

Can you try yarn upgrade?

If using npm?

Actually, feel free to close this out. I realized the problem was trying to swap this out with hand-rolled/hacked version of the same thing. Once I ripped everything out and started with the content module first, I started to understand your paradigm for everything, and i'm slowly adapting to it (much better implementation).

Just a quick note, as I still ran into this while starting over -- if you get this error, it's likely you have an issue with YAML frontmatter. I had one file like this:

---
title: 300
---

And the module didn't like that, until I did this:

---
title: '300'
---

Hope that helps!

I'm hitting this issue with netlify-cms where frontmatter is of type integer, e.g.

---
episode: 1
---

Fixed by switching to string type:

---
episode: '1'
---

This also appears to affect yaml lists:

---
tags: ['a', 'b']
---

or

---
tags: 
 - a
 - b
---

I encountered the issue at nuxt dev if adding 'tags' to content.fullTextSearchFields option.

We're depending on LokiDB and its full-text-search plugin which doesn't support indexing array fields.

Check out #178 for a workaround.

Was this page helpful?
0 / 5 - 0 ratings