oddcamp / ember-cli-markdown-as-json

Create markdown files with yaml configuration, access them as ember-data models in your app. Live reload on edits.
MIT License
2 stars 1 forks source link

Not working #3

Open RobbieTheWagner opened 6 years ago

RobbieTheWagner commented 6 years ago

I tried adding a content directory with a post in it and upon running ember s I get Cannot convert undefined or null to object. Any ideas?

  - stack: TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at Class.postprocessTree (/Users/rwwagner/shipshape/shipshape.io/node_modules/ember-cli-markdown-as-json/index.js:40:27)
    at projectOrAddon.addons.reduce (/Users/rwwagner/shipshape/shipshape.io/node_modules/ember-cli/lib/utilities/addon-process-tree.js:6:25)
    at Array.reduce (<anonymous>)
    at addonProcessTree (/Users/rwwagner/shipshape/shipshape.io/node_modules/ember-cli/lib/utilities/addon-process-tree.js:4:32)
    at EmberApp.addonPostprocessTree (/Users/rwwagner/shipshape/shipshape.io/node_modules/ember-cli/lib/broccoli/ember-app.js:671:12)
    at EmberApp.toTree (/Users/rwwagner/shipshape/shipshape.io/node_modules/ember-cli/lib/broccoli/ember-app.js:1850:17)
    at module.exports (/Users/rwwagner/shipshape/shipshape.io/ember-cli-build.js:93:14)
    at Builder.setupBroccoliBuilder (/Users/rwwagner/shipshape/shipshape.io/node_modules/ember-cli/lib/models/builder.js:56:19)
    at new Builder (/Users/rwwagner/shipshape/shipshape.io/node_modules/ember-cli/lib/models/builder.js:30:10)
    at ServeTask.run (/Users/rwwagner/shipshape/shipshape.io/node_modules/ember-cli/lib/tasks/serve.js:24:55)
    at Promise.resolve.then (/Users/rwwagner/shipshape/shipshape.io/node_modules/ember-cli/lib/models/command.js:243:46)
    at tryCatcher (/Users/rwwagner/shipshape/shipshape.io/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:329:19)
    at invokeCallback (/Users/rwwagner/shipshape/shipshape.io/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:507:31)
    at /Users/rwwagner/shipshape/shipshape.io/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:571:14
    at flush (/Users/rwwagner/shipshape/shipshape.io/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:2432:5)
    at process._tickCallback (internal/process/next_tick.js:150:11)
vasilakisfil commented 6 years ago

Hi @rwwagner90, what's your ember-cli-markdown-as-json settings in config/environment.js ?

RobbieTheWagner commented 6 years ago

I'm not sure. I converted to using a different addon. I will try this one again and copy the config over later.

RobbieTheWagner commented 6 years ago

I tried:

ENV['ember-cli-markdown-as-json'] = {
    contentDirectory: 'app/blog',
    attributes: {
      author: 'string',
      date: 'date',
      title: 'string',
      slug: 'string'
    }
  };

It told me it could not watch missing directory "content" or something like that. Looks like contentDirectory option does not work.