sintaxi / surge

CLI for the surge.sh CDN
https://surge.sh
2.86k stars 136 forks source link

Cannot publish from node 0.8.10/9.7.1 with surge@0.20.1 #309

Open jacques opened 6 years ago

jacques commented 6 years ago

I keep getting:

$ ENDPOINT=surge.sh surge list

undefined:1
<!DOCTYPE html><html><head><head><meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"><link rel="stylesheet" href="https://code.cdn.mozilla.net/fonts/fira.css"><style>body{
^

SyntaxError: Unexpected token < in JSON at position 0
    at JSON.parse (<anonymous>)
    at Request._callback (/usr/local/lib/node_modules/surge/lib/middleware/util/helpers.js:124:30)
    at Request.self.callback (/usr/local/lib/node_modules/surge/node_modules/request/request.js:186:22)
    at emitTwo (events.js:126:13)
    at Request.emit (events.js:214:7)
    at Request.<anonymous> (/usr/local/lib/node_modules/surge/node_modules/request/request.js:1163:10)
    at emitOne (events.js:116:13)
    at Request.emit (events.js:211:7)
    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/surge/node_modules/request/request.js:1085:12)
    at Object.onceWrapper (events.js:313:30)
$ ENDPOINT=surge.surge.sh surge list

undefined:1
<!DOCTYPE html><html><head><head><meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"><link rel="stylesheet" href="https://code.cdn.mozilla.net/fonts/fira.css"><style>body{
^

SyntaxError: Unexpected token < in JSON at position 0
    at JSON.parse (<anonymous>)
    at Request._callback (/usr/local/lib/node_modules/surge/lib/middleware/util/helpers.js:124:30)
    at Request.self.callback (/usr/local/lib/node_modules/surge/node_modules/request/request.js:186:22)
    at emitTwo (events.js:126:13)
    at Request.emit (events.js:214:7)
    at Request.<anonymous> (/usr/local/lib/node_modules/surge/node_modules/request/request.js:1163:10)
    at emitOne (events.js:116:13)
    at Request.emit (events.js:211:7)
    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/surge/node_modules/request/request.js:1085:12)
    at Object.onceWrapper (events.js:313:30)
giacomoalonzi commented 6 years ago

Same problem here, I rolled back to 0.19 but surge not upload updated file

       email: my@email
       token: *****************
       project path: /path/to/project
       size: 43 files, 23.5 MB
       domain: myaddress.surge.sh

any hint?

leewp14 commented 6 years ago

Finally someone same with me. This happened to me when I'm halfway deploying my website. And I tried to relogin into surge by logging out, and now couldnt login back again :cry:
screenshot_2018-03-07_21-09-41

balupton commented 6 years ago

Title should be updated as this is not just node 0.10

> node -v
v9.7.1

> npm i -g surge
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
/Users/balupton/.nvm/versions/node/v9.7.1/bin/surge -> /Users/balupton/.nvm/versions/node/v9.7.1/lib/node_modules/surge/lib/cli.js
+ surge@0.20.1
updated 1 package in 3.674s

> surge -v

undefined:1
<!DOCTYPE html><html><head><head><meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"/><link rel="stylesheet" href="https://code.cdn.mozilla.net/fonts/fira.css"/><style>body{
^

SyntaxError: Unexpected token < in JSON at position 0
    at JSON.parse (<anonymous>)
    at Request._callback (/Users/balupton/.nvm/versions/node/v9.7.1/lib/node_modules/surge/lib/middleware/util/helpers.js:124:30)
    at Request.self.callback (/Users/balupton/.nvm/versions/node/v9.7.1/lib/node_modules/surge/node_modules/request/request.js:186:22)
    at Request.emit (events.js:127:13)
    at Request.<anonymous> (/Users/balupton/.nvm/versions/node/v9.7.1/lib/node_modules/surge/node_modules/request/request.js:1163:10)
    at Request.emit (events.js:127:13)
    at IncomingMessage.<anonymous> (/Users/balupton/.nvm/versions/node/v9.7.1/lib/node_modules/surge/node_modules/request/request.js:1085:12)
    at Object.onceWrapper (events.js:219:13)
    at IncomingMessage.emit (events.js:132:15)
    at endReadableNT (_stream_readable.js:1101:12)
leewp14 commented 6 years ago

here is not working with node 8.9.4

leewp14@CTK942S:~$ node -v
v8.9.4
balinterdi commented 6 years ago

I also have problems, Surge doesn't deploy the updated assets.

node: 8.9.0 surge: 0.17.2

sintaxi commented 6 years ago

A DNS issue was just resolved. This was human error on my part.

There may still be an issue with surge list on some accounts that is a separate issues though. Let me know your findings if your still see things that are broken.

giacomoalonzi commented 6 years ago

Fixed for me on 0.19!

segunmicheal27 commented 4 years ago

issue on node: v14.17.0 as well

segunmicheal27 commented 4 years ago

this is error we got

Invalid or unexpected token