My name is jeremy . I’m rather new to using Shopify cli, and I’ve been trying to create a subscription app extension .
but after running “Shopify extension create” and choosing my app and extension name , the “initializing project” process stops with this error.(it doesnt give an error when creating other extensions)
I’ve found the problem - I think. At least it’s working for me.
The Shopify CLI file ‘choose_next_available_port.rb’ method ‘available’ returns true or false depending on if the default port is open. To do this they try to open a socket for the port, and catch ECONNREFUSED errors. If the connection is refused the port is open, right? Well instead of throwing ECONNREFUSED I’m getting ETIMEDOUT, so it doesn’t catch that, and Shopify CLI thinks the port is being used.
I’ve changed the rescue block to handle ETIMEDOUT instead of ECONNREFUSED and now it’s working. This is on line 31 of the file ‘choose_next_available_port.rb’ in Shopify-CLI version 2.1.0
I got it working and it loads the Post Purchase extension successfully.
def find_available_port(runtime_configuration)
puts 'Hack fix is in place.'
return runtime_configuration
end
If you’ve edited the correct file you should see “Hack fix is in place.” in the terminal when you run ‘shopify extension serve’, and hopefully it works.
Hmm, strange that the hack no longer works. It doesn’t look like they’ve changed anything related in the serve.rb file.
I have a pull request out, but it’s not been merged.
Also - I’ve since switched to a new dev computer and the problem has resolved itself. Both machines use Windows 10, etc… but the underlying problem has something to do with system configuration.