These are chat archives for jescalan/roots

6th
Sep 2016
Edin Abazi
@edinchez
Sep 06 2016 22:20
guys, im lost, i dont know what to do
im using dynamic-content for my blog page, and it works perfectly fine
Jeff Escalante
@jescalan
Sep 06 2016 22:20
oh no!
Edin Abazi
@edinchez
Sep 06 2016 22:20
now im trying to a projects page with the same implementation
and i keep getting a layout error
isnt dynamic-content able to work on 2 different "pages"?
sorry not a layout error
Error: TypeError: D:\Sites\edin.space\views\projects\two-cats-kitchen.jade:4
    2| title: 'Two Cats Kitchen'
    3| date: 2016-09-05
  > 4| cover: 'twocats/twocats-cover.jpg'
    5| ---
    6|
    7| extends ../_layouts/_project-layout

Cannot read property 'title' of undefined
  at Error (native)
  at on_error (C:\Users\edin9\AppData\Roaming\npm\node_modules\roots\lib\cli\watch.js:76:11)
  at Roots.<anonymous> (C:\Users\edin9\AppData\Roaming\npm\node_modules\roots\lib\cli\watch.js:53:14)
  at emitOne (events.js:96:13)
  at Roots.emit (events.js:188:7)
  at Compile.<anonymous> (C:\Users\edin9\AppData\Roaming\npm\node_modules\roots\lib\api\compile.js:74:20)
  at tryCatchReject (C:\Users\edin9\AppData\Roaming\npm\node_modules\roots\node_modules\when\lib\makePromise.js:845:30)
  at runContinuation1 (C:\Users\edin9\AppData\Roaming\npm\node_modules\roots\node_modules\when\lib\makePromise.js:804:4)

  at Rejected.when (C:\Users\edin9\AppData\Roaming\npm\node_modules\roots\node_modules\when\lib\makePromise.js:625:4)
  at Pending.run (C:\Users\edin9\AppData\Roaming\npm\node_modules\roots\node_modules\when\lib\makePromise.js:483:13)
  at Scheduler._drain (C:\Users\edin9\AppData\Roaming\npm\node_modules\roots\node_modules\when\lib\Scheduler.js:62:19)
  at Scheduler.drain (C:\Users\edin9\AppData\Roaming\npm\node_modules\roots\node_modules\when\lib\Scheduler.js:27:9)
  at _combinedTickCallback (internal/process/next_tick.js:67:7)
  at process._tickCallback (internal/process/next_tick.js:98:9)
Jeff Escalante
@jescalan
Sep 06 2016 22:21
there's not enough here in this error message for me to be able to diagnose an issue
Edin Abazi
@edinchez
Sep 06 2016 22:22
im trying to list my projects like this
each project in site.views.projects
                        article.project

                            .project-image.on-top
                                img(src="/img/projects/" + project.cover)

                            .project-info
                                .info-head
                                    h2= project.title
                                .info-bottom
                                    p= project.date
Jeff Escalante
@jescalan
Sep 06 2016 22:22
you are calling something.title somewhere
first step is logging out something with = JSON.stringify(something)
Edin Abazi
@edinchez
Sep 06 2016 22:23
hmm, what do you mean exactly?
Jeff Escalante
@jescalan
Sep 06 2016 22:23
it says cannot read property title of undefined
this means you have some object you are trying to access title on
and its undefined
so you need to go find the place where you are trying to use title
then figure out what it is that's undefined
then if you remove it, does it start working?
Edin Abazi
@edinchez
Sep 06 2016 22:24
let me see
Jeff Escalante
@jescalan
Sep 06 2016 22:24
or are there also more errors
narrow it down to one small particular case
Edin Abazi
@edinchez
Sep 06 2016 22:24
i was getting the same error twice
the title one
so im guessing its in both the files where im calling title, in the project-layout and the projects index where i list em
Jeff Escalante
@jescalan
Sep 06 2016 22:25
narrow it down to one
Edin Abazi
@edinchez
Sep 06 2016 22:26
i commented out both .title calls in both files and im getting the same error, apparently the title error is coming from the "post" file itself, with the frontmatter
that doesnt make sense
Jeff Escalante
@jescalan
Sep 06 2016 22:26
yep
so if you remove the front matter does it work?
this is just standard debugging
narrow down the error, find out what it takes to fix it
then you have isolated the issue :)
Edin Abazi
@edinchez
Sep 06 2016 22:30
hmm, i renamed each project in site.views.projects to each post in site.views.projects
and it works now
well, calling them with post.title etc
thats unusual
Jeff Escalante
@jescalan
Sep 06 2016 23:05
well, glad it's working!
good work debugging