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 'loginUrl' of undefined #179

Closed corinnekunze closed 8 years ago

corinnekunze commented 8 years ago

I saw this issue brought up before but 'sqs buster' does not seem to help resolve our issue.

Having this happen across multiple machines now for the same repo.

sqs server
> sqs-log Squarespace server running localhost:5050
> sqs-log Logging into Squarespace...
/usr/local/lib/node_modules/node-squarespace-server/node_modules/node-squarespace-middleware/squarespace-middleware.js:120
            url: json.targetWebsite.loginUrl,
                                   ^

TypeError: Cannot read property 'loginUrl' of undefined
    at Request._callback (/usr/local/lib/node_modules/node-squarespace-server/node_modules/node-squarespace-middleware/squarespace-middleware.js:120:36)
    at Request.self.callback (/usr/local/lib/node_modules/node-squarespace-server/node_modules/request/request.js:199:22)
    at emitTwo (events.js:87:13)
    at Request.emit (events.js:172:7)
    at Request.<anonymous> (/usr/local/lib/node_modules/node-squarespace-server/node_modules/request/request.js:1036:10)
    at emitOne (events.js:82:20)
    at Request.emit (events.js:169:7)
    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/node-squarespace-server/node_modules/request/request.js:963:12)
    at emitNone (events.js:72:20)
    at IncomingMessage.emit (events.js:166:7)

We recently changed our squarespace password and have updated the template.conf to reflect this new password.

We were all using a git config credential.helper cache so we wouldn't have to enter credentials on each pull push. I have unset them... still nothing and unable to run the server.

Any ideas?

corinnekunze commented 8 years ago

I was able to get the server to run finally by uninstalling node-squarespace-server and reinstalling it on my machine with:

npm uninstall -g node-squarespace-server and npm install -g node-squarespace-server

For whatever reason it was rushing into logging in with an undefined login. Reinstalling allowed me to get the login screen back and enter my credentials.

kitajchuk commented 8 years ago

Glad it worked. It uses keychain to store login creds so possibly there are some weird hiccups that can happen there. Always using the latest version is recommended as well :)

lulato commented 8 years ago

I'm stilling getting this error, @corinnekunze , could you go into a little bit more detail in how did you solve this problem?

lulato commented 8 years ago

Right now, I am not able to get the prompt back after unstailling. Is there another way to clear the cache or my old credentials?

corinnekunze commented 8 years ago

@lulato Not sure I can be much extra help other than running those npm uninstall commands as well as attempting to bust the cache with sqs buster.

One reason that this happened was because we changed our password for our account for squarespace. I was using the git config credential.helper cache to store the old password. I think I used a command like this to unset them (not sure that made a difference or not): git config --global --unset credential.helper

I also tried updating to the most recent version of node-squrespace-server.

You'll also want to make sure that the password is accurate in your template.conf.

Hope that helps.

kitajchuk commented 8 years ago

@lulato @corinnekunze you can open keychain access and delete the entries for SquarespaceEmail and SquarespacePassword to clear that out :)

lulato commented 8 years ago

That keychain access tip worked.