kitajchuk / node-squarespace-server

DEPRECATED! A local Squarespace development server in node.js.
MIT License
186 stars 26 forks source link

TypeError: Cannot read property 'links' of null #167

Open ghost opened 8 years ago

ghost commented 8 years ago

I think I had this issue in the past once. Hard to know what's causing it. I have 3 navigation areas in Squarespace, one of which is all folders and external links, another of which is ALL external links. I wonder if that could be an issue?

Here's the error:

> sqs-log Get local cache for key => page-homepage.html
/usr/local/lib/node_modules/node-squarespace-server/squarespace-template.js:1120
    var navContext = getNavigationContextItems( navigation, (pageLinks || navigation.links), pageJson ),
                                                                                    ^

TypeError: Cannot read property 'links' of null
    at getNavigationContext (/usr/local/lib/node_modules/node-squarespace-server/squarespace-template.js:1120:85)
    at replaceNavigations (/usr/local/lib/node_modules/node-squarespace-server/squarespace-template.js:1006:23)
    at Object.renderTemplate (/usr/local/lib/node_modules/node-squarespace-server/squarespace-template.js:516:16)
    at /usr/local/lib/node_modules/node-squarespace-server/squarespace-server.js:272:29
    at /usr/local/lib/node_modules/node-squarespace-server/node_modules/node-squarespace-middleware/squarespace-middleware.js:376:13
    at Request._callback (/usr/local/lib/node_modules/node-squarespace-server/node_modules/node-squarespace-middleware/squarespace-middleware.js:300:9)
    at Request.self.callback (/usr/local/lib/node_modules/node-squarespace-server/node_modules/request/request.js:199:22)
    at emitTwo (events.js:100:13)
    at Request.emit (events.js:185:7)
    at Request.<anonymous> (/usr/local/lib/node_modules/node-squarespace-server/node_modules/request/request.js:1036:10)
flppv commented 8 years ago

I have some issue

kitajchuk commented 8 years ago

I think this has something to do with using a <squarespace:navigation> tag without a navigationId attribute. Any thoughts on that?