kitajchuk / node-squarespace-server

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

data.location undefined #195

Closed mc2tc closed 8 years ago

mc2tc commented 8 years ago

Hi-- I'm wondering if you can help with the following error. Thanks in advance.

mart @ ~/desktop/pands-development [8] → sqs server

sqs-log Issue compiling less file global.less => 'social-icon-font.less' wasn't found sqs-log Issue compiling less file mobile.less => 'sqs-grid-breaker.less' wasn't found sqs-log Squarespace server running localhost:5050 sqs-log Logging into Squarespace... sqs-log ...Logged in to Squarespace sqs-log Fetching data from Squarespace... sqs-log Fetched fullData for collection 574a07ad1d07c0e0855f3c74 sqs-log Fetched fullData for collection 574a0a7e01dbae663911a423 sqs-log Fetched fullData for collection 574a0ba04c2f85ab1d888310 sqs-log Fetched fullData for collection 574a0ba64c2f85ab1d88832e sqs-log Fetched fullData for collection 574a0a1101dbae663911a270 sqs-log ...Fetched data from Squarespace sqs-log Get local cache for key => page-homepage.html sqs-log Get local cache for key => page-homepage.json sqs-log Store local cache for key => page-homepage.json sqs-log Store local cache for key => page-homepage.html sqs-log Get local cache for key => page-homepage.html /usr/local/lib/node_modules/node-squarespace-server/node_modules/node-squarespace-jsont/lib/predicates/location.js:23 return ( data.location.addressTitle || data.location.addressLine1 || data.location.addressLine2 || data.location.addressCountry ) ? true : false; ^

TypeError: Cannot read property 'addressTitle' of undefined at module.exports (/usr/local/lib/node_modules/node-squarespace-server/node_modules/node-squarespace-jsont/lib/predicates/location.js:23:27) at /usr/local/lib/node_modules/node-squarespace-server/node_modules/node-squarespace-jsont/lib/predicates/index.js:83:23 at _DoPredicates (/usr/local/lib/node_modules/node-squarespace-server/node_modules/node-squarespace-jsont/lib/jsontemplate.js:488:21) at _Execute (/usr/local/lib/node_modules/node-squarespace-server/node_modules/node-squarespace-jsont/lib/jsontemplate.js:428:7) at _DoSection (/usr/local/lib/node_modules/node-squarespace-server/node_modules/node-squarespace-jsont/lib/jsontemplate.js:469:5) at _Execute (/usr/local/lib/node_modules/node-squarespace-server/node_modules/node-squarespace-jsont/lib/jsontemplate.js:428:7) at Template.render (/usr/local/lib/node_modules/node-squarespace-server/node_modules/node-squarespace-jsont/lib/jsontemplate.js:823:3) at Template.expand (/usr/local/lib/node_modules/node-squarespace-server/node_modules/node-squarespace-jsont/lib/jsontemplate.js:828:8) at Object.render (/usr/local/lib/node_modules/node-squarespace-server/node_modules/node-squarespace-jsont/squarespace-jsont.js:29:25) at Object.renderTemplate (/usr/local/lib/node_modules/node-squarespace-server/squarespace-template.js:540:32)

kitajchuk commented 8 years ago

Hmm. Looks like the {.location?} predicate is blowing up on you. What is the context in which you are using it?

mc2tc commented 8 years ago

I fixed the issue thanks. Just hadn't included an address in Squarespace settings.

kitajchuk commented 8 years ago

Ok, cool. Glad it was a simple fix :)