nuxt-community / feed-module

Everyone deserves RSS, ATOM and JSON feeds!
MIT License
226 stars 36 forks source link

unclear documentation #40

Closed tcurdt closed 5 years ago

tcurdt commented 5 years ago

The top level configuration works as expected:

  modules: [
    ['@nuxtjs/feed', {
    }],
  ],
  feed: [
    {
     path: '/feed.xml',
     async create (feed) {},
     cacheTime: 1000 * 60 * 15,
     type: 'rss2',
     data: ['Some additional data']
    }
  ],

Moving this into the other section as the docs suggest:

  modules: [
    ['@nuxtjs/feed', {
        path: '/feed.xml',
        async create (feed) {},
        cacheTime: 1000 * 60 * 15,
        type: 'rss2',
        data: ['Some additional data']
    }],
  ],

gives

Cannot read property 'factory' of undefined                                                                                     17:19:11

  at ModuleContainer.feed (node_modules/@nuxtjs/feed/lib/module.js:24:27)
  at ModuleContainer.addModule (node_modules/@nuxt/core/dist/core.js:177:34)
  at promise.then (node_modules/@nuxt/utils/dist/utils.js:1664:43)
  at process.runNextTicks [as _tickCallback] (internal/process/next_tick.js:47:5)
  at Function.Module.runMain (internal/modules/cjs/loader.js:804:11)
  at internal/main/run_main_module.js:21:11

Checking the source and logging what this.options contains it seems like only the top level config is supported.

ricardogobbosouza commented 5 years ago

@tcurdt docs is wrong This module only works on top leve configuration

ricardogobbosouza commented 5 years ago

I am works to resolve