ImmaZoni / nightfury-nuxt

https://nightfury-nuxt.herokuapp.com/
2 stars 0 forks source link

ERROR operatorPackage[operator] is not a function #18

Open ImmaZoni opened 3 years ago

ImmaZoni commented 3 years ago

Hello! So i am having an issue with the blog portion of my animal resuces website.

This has been fighting me for a bit now and ANY help is greatly appreciated.

WHATS HAPPENING I am trying to load url/blog and getting the error below.

If i were to go to url/blog/my-first-blog-post it loads with no issues, it looks to be just the blog view page that is giving me issues.

ERROR

ERROR  operatorPackage[operator] is not a function                   00:31:54

  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 asyncData (_slug.vue:81:0)

WHAT IVE TRIED

The github nuxt issue was the one that seemed to be the most helpful, as it pointed me to the .where() function which is used within the ~/blog/_slug.vue file listed below.

  async asyncData ({ $content, params }) {
    const article = await $content('articles', params.slug).fetch()
    const tagsList = await $content('tags')
      .only(['name', 'slug'])
      .where({ name: { $containsAny: article.tags } })
      .fetch()
    const tags = Object.assign({}, ...tagsList.map(s => ({ [s.name]: s })))
    const [prev, next] = await $content('articles')
      .only(['title', 'slug'])
      .sortBy('createdAt', 'asc')
      .surround(params.slug)
      .fetch()
    return {
      article,
      tags,
      prev,
      next
    }
  }

Side note this project is using Vuetify aswell, please let me know if there is any other questions that may be helpful.

Replication Link - https://codesandbox.io/s/zealous-shirley-fr3bj GitHub Link - https://github.com/ImmaZoni/nightfury-nuxt

PS: Feel free to contribute to the code if you would like any help is always appreciated :)

thomasbnt commented 3 years ago

Also the same error on my website under @content/nuxtjs :c