Skip to content
Advertisement

TypeError: _this.$content is not a function – Nuxt.js Content

I am trying to use Nuxt.js Content in my project. The problem is that when I try to use $content method in my project the TypeError: _this.$content is not a function occurs:

JavaScript

I imported the @nuxt/content in Nuxt config and in typescript config.

nuxt.config.js

JavaScript

tsconfig.json

JavaScript

Advertisement

Answer

Nuxt content v2 needs Nuxt3. If you’re using Nuxt2, you should use the v1.

As stated at the end of this page: https://content.nuxtjs.org/get-started#render-pages

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement