surge
surge copied to clipboard
Surge Teardown Not Working
I've mistakenly created a project with an invalid domain name. I'm trying to tear it down but was unsuccessful.
The domain name when I ran surge list
The result when I ran surge teardown
Is there anyway I can tear down the project with the invalid name? I tried several times but was unsuccessful.
@febreroinfo it looks like this is something @sintaxi will have to do in the backend
Thanks @brandonb927. @sintaxi will you be able to assist regarding this matter? It would be greatly appreciated.
I have the same issue, can the cli allow space in the input?
\
or quoted by single/double quote
in the latest version of surge list
, I see an id beside the domain name, I tried to teardown the site using the id but it raise an error
surge teardown 1477261572142
assert.js:41
throw new errors.AssertionError({
^
AssertionError [ERR_ASSERTION]: 'number' == 'string'
at parse (/home/beenotung/.config/yarn/global/node_modules/url-parse-as-address/index.js:9:10)
at Object.exports.validDomain (/home/beenotung/.config/yarn/global/node_modules/surge/lib/middleware/util/helpers.js:446:56)
at module.exports (/home/beenotung/.config/yarn/global/node_modules/surge/lib/middleware/domainOrSilent.js:29:15)
at next (/home/beenotung/.config/yarn/global/node_modules/surge/lib/middleware/util/skin.js:20:11)
at exports.suggestDomainFromCname (/home/beenotung/.config/yarn/global/node_modules/surge/lib/middleware/discovery.js:20:10)
at next (/home/beenotung/.config/yarn/global/node_modules/surge/lib/middleware/util/skin.js:20:11)
at exports.setDomainFromArgs (/home/beenotung/.config/yarn/global/node_modules/surge/lib/middleware/discovery.js:45:10)
at next (/home/beenotung/.config/yarn/global/node_modules/surge/lib/middleware/util/skin.js:20:11)
at module.exports (/home/beenotung/.config/yarn/global/node_modules/surge/lib/middleware/shorthand.js:7:3)
at next (/home/beenotung/.config/yarn/global/node_modules/surge/lib/middleware/util/skin.js:20:11)
Hello, I have the same problem on this date.
I launch a new surge command by following the video on the surge presentation and I inadvertently create a domain that can not be removed :
I tried to use :
-
ID
but we only can use string in the teardown command -
\
&%20
for the space nothing work
I hope this will help you
I think I found the problem, the Teardown command detects: rich-mass.surge.sh
and new-oms-website.surge.sh
as two parameters.
For the moment, it's bad, but I deleted the false domain by hard-coding the name in teardown.js on line 45:
return remove(parseUrl(req.domain).host)
to return remove("rich-mass.surge.sh new-oms-website.surge.sh")
I think to solve this error, we can:
- Ban spacing in domain name
- Update
teardown
to incorporate use of a character string or domain id
👋
I think it's better not to bad domain with space in the teardown command, as there exists such records.
It may be better to allow deleting domain with space like surge teardown "a b c.surge"
;
allowing to delete by ID is also good
@Craaftx thanks your suggestion, hard-coding works best for me in the one-time situation.
hey just thought I'd tie a few of these together also discussed: #230
If you typed it in one line like "surge teardown domain.surge.sh", try typing "surge" first and a prompt for the domain name will show.
I also had this problem of weird domain registered in surge accidentally somehow
1539668485543 document.body.style.visibility = "hidden"; 2 years ago surge surge.sh Standard
Finally, @Craaftx 's solution of hard coding the url worked to remove the weird domain 'document.body.style.visibility = "hidden";'
I URL encoded and hard coded into the teardown.js
return remove("document.body.style.visibility%20%3D%20%22hidden%22%3B")
Now I got rid of that weird domain url and got the Success message for the removal of it.
Note: surge teardown url (url doesn't matter as it is hardcoded as long as the function accepts it)
Also I immediately reverted the code back to original (return remove(parseUrl(req.domain).host)
) after successful teardown.
`surge teardown "document.body.style.visibility%20%3D%20%22hidden%22%3B"
Success - document.body.style.visibility%20%3D%20%22hidden%22%3B has been removed.`
I also vote for teardown by id:
surge teardown 1539668485543