surge icon indicating copy to clipboard operation
surge copied to clipboard

Deployment broken

Open johntringham opened this issue 1 year ago • 9 comments

Steps to replicate:

Deploy or redeploy any surge project via the surge command line

Expected: it deploys and you can access it in a browser soon after

Actual: The command line tool says it deployed successfully, but the url it deploys to displays "project not found". This is happening with new projects and previously existing ones that are being redeployed

Example affected site: https://shiny-disease.surge.sh/ - this was deployed a few minutes ago. It's just a very basic index.html file, but it's displaying as "project not found", despite the surge cli saying it was successfully deployed.

This bug was mentioned in a comment here: https://github.com/sintaxi/surge/issues/514#issuecomment-1855283693 - which is presumably a related issue due to the timings

johntringham avatar Dec 14 '23 11:12 johntringham

I see a 404 for my latest deployment too, but It's not just on deployment – list throws an error too.

image

marclucraft avatar Dec 14 '23 11:12 marclucraft

@marclucraft Yeah I'm seeing this error from surge list as well - that issue was reported earlier over here: https://github.com/sintaxi/surge/issues/514 . Hopefully both issues have the same root cause and can be fixed together, but I wanted to log this separately as it feels like the bigger overall problem

johntringham avatar Dec 14 '23 12:12 johntringham

@marclucraft You can manually patch list.js something like this to get around the list issue for the time being.

        var row = [
          perm || project.domain,
          project.timeAgoInWords?.grey,
          project.cmd?.grey,
          project.platform?.grey,
          pn || "",
          //lastcmd !== project.cmd ? (project.cmd).grey : "",
        ]

tadayosi avatar Dec 14 '23 13:12 tadayosi

Can confirm this happens for my site as well; here's a text version of the error from surge list if necessary.

PS C:\Users\pigrammer\project> surge list

C:\Users\pigrammer\AppData\Roaming\npm\node_modules\surge\lib\middleware\list.js:44
          project.timeAgoInWords.grey,
                                 ^

TypeError: Cannot read property 'grey' of undefined
    at C:\Users\pigrammer\AppData\Roaming\npm\node_modules\surge\lib\middleware\list.js:44:34
    at Array.forEach (<anonymous>)
    at Request._callback (C:\Users\pigrammer\AppData\Roaming\npm\node_modules\surge\lib\middleware\list.js:33:12)
    at Request.self.callback (C:\Users\pigrammer\AppData\Roaming\npm\node_modules\surge\node_modules\request\request.js:185:22)
    at Request.emit (events.js:375:28)
    at Request.<anonymous> (C:\Users\pigrammer\AppData\Roaming\npm\node_modules\surge\node_modules\request\request.js:1154:10)
    at Request.emit (events.js:375:28)
    at IncomingMessage.<anonymous> (C:\Users\pigrammer\AppData\Roaming\npm\node_modules\surge\node_modules\request\request.js:1076:12)
    at Object.onceWrapper (events.js:481:28)
    at IncomingMessage.emit (events.js:387:35)

pigrammer3 avatar Dec 14 '23 13:12 pigrammer3

@marclucraft You can manually patch list.js something like this to get around the list issue for the time being.

        var row = [
          perm || project.domain,
          project.timeAgoInWords?.grey,
          project.cmd?.grey,
          project.platform?.grey,
          pn || "",
          //lastcmd !== project.cmd ? (project.cmd).grey : "",
        ]

This change fixes issue with surge list but not with getting Project not found after making deployment.

elgatito avatar Dec 14 '23 14:12 elgatito

Appreciated @elgatito! Although, my main concern is deployment. Hope a fix can be found soon.

marclucraft avatar Dec 14 '23 14:12 marclucraft

Hey all, Brock from surge here. Definitely there is an issue. Looking into it. Thanks for reporting.

sintaxi avatar Dec 14 '23 18:12 sintaxi

I just realized something very interesting. I have one surge site redirecting to another surge site (because of a typo that I noticed was very common) with just a simple index.html:

<meta http-equiv="Refresh" content="0; url='https://other-site.surge.sh'" />

Now if I go to this site, say redirect.surge.sh, it still redirects me to other-site.surge.sh. Now, this isn't due to any caching, because I tried it in incognito mode and on other devices on which I'd never visited the site before, and it still has this behavior. Of course, once the browser switches to other-site.surge.sh, it says "project not found", but I find it strange that it kept the HTML for that specific site.

pigrammer3 avatar Dec 14 '23 19:12 pigrammer3

I've just retested on https://shiny-disease.surge.sh/ and another surge subdomain - it's back up and deploying successfully from what I can see. @sintaxi thanks for looking into it - any chance of a debrief/update on what caused the problem? I won't close this issue just yet in case the cause is still ongoing

johntringham avatar Dec 16 '23 13:12 johntringham

Old ticket. Issue resolved. closing.

sintaxi avatar Jun 25 '24 17:06 sintaxi