Home

Issue: 2691

Generating dynamic routes Error: "generate.routes" must be an array

[issue link]

I’m using Nuxtent content module. I’m following the directions on the docs page replaced the URL with local content-api generated by Nuxtent.

When I run generate command I get the following Error: "generate.routes" must be an array

const axios = require('axios')

module.exports = {
  generate: {
    routes: function () {
      return axios.get('https://my-api/users')
      .then((res) => {
        return res.data.map((user) => {
          return '/users/' + user.id
        })
      })
    }
  }}

This question is available on Nuxt.js community (#c2339)