Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Running dev app with --tunnel-url flag throws command not found error

Solved

Running dev app with --tunnel-url flag throws command not found error

devenbryant
Shopify Partner
16 2 7

I am trying to run a dev server using a cloudflare tunnel.  

I Ran this command according to the documentation (Note: I've replaced my actual url with <tunnel url>:<port>)

sudo npm run dev --tunnel-url https://<tunnel url>:<port>

But it returns

command app:dev:https://<tunnel url>:<port> not found 

 

Environment Info

Shopify CLI version

node ➜ /workspaces/shopify-devkit/shopify-saleschannel (main ✗) $ shopify version
Current Shopify CLI version: 3.21.0

package.json

node ➜ /workspaces/shopify-devkit/shopify-saleschannel (main ✗) $ cat package.json 
{
  "name": "shopify-saleschannel",
  "version": "1.0.0",
  "main": "web/index.js",
  "license": "UNLICENSED",
  "scripts": {
    "shopify": "shopify",
    "build": "shopify app build",
    "dev": "shopify app dev",
    "info": "shopify app info",
    "generate": "shopify app generate",
    "deploy": "shopify app deploy"
  },
  "dependencies": {
    "@shopify/app": "3.22.1",
    "@shopify/cli": "3.22.1"
  },
  "author": "node"

Oddly, shopify version reported does no match my dependencies (even after upgrading)

node ➜ /workspaces/shopify-devkit/shopify-saleschannel (main ✗) $ shopify version
Current Shopify CLI version: 3.21.0
💡 Version 3.22.1 available!
node ➜ /workspaces/shopify-devkit/shopify-saleschannel (main ✗) $ shopify upgrade
Upgrading CLI from 3.21.0 to 3.22.1...
Executing... npm install @shopify/cli@latest @shopify/app@latest --save-prod
up to date, audited 560 packages in 925ms

115 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
✅ Success! Upgraded Shopify CLI to version 3.22.1.
node ➜ /workspaces/shopify-devkit/shopify-saleschannel (main ✗) $ shopify version
Current Shopify CLI version: 3.21.0
💡 Version 3.22.1 available

and Shopify logs analytics event data if useful

2052 [2022-11-09T06:37:47.230Z 6e0e145e-037e-4b91-b7fa-89e54a6ebb2e DEBUG]: Analytics event sent: {
2053 "command": "logs",
2054 "time_start": 1667975653969,
2055 "time_end": 1667975866334,
2056 "total_time": 212365,
2057 "success": true,
2058 "cli_version": "3.21.0",
2059 "ruby_version": "2.7.4",
2060 "node_version": "16.18.0",
2061 "is_employee": false,
2062 "uname": "linux amd64",
2063 "env_ci": false,
2064 "env_plugin_installed_any_custom": false,
2065 "env_plugin_installed_shopify": "[\"@shopify/cli\",\"@shopify/plugin-ngrok\",\"@shopify/theme\"]",
2066 "env_shell": "bash",
...
2068 "env_cloud": "localhost",
2069 "env_package_manager": "npm",
2070 "cmd_all_launcher": "unknown",
2071 "cmd_all_plugin": "@shopify/cli",
2072 "cmd_all_path_override": false,
2073 "args": "",
2074 "env_plugin_installed_all": "[\"@shopify/cli\",\"@shopify/plugin-ngrok\",\"@shopify/theme\"]",
2075 "metadata": "{\"extraPublic\":{},\"extraSensitive\":{}}"

 

Accepted Solution (1)

devenbryant
Shopify Partner
16 2 7

This is an accepted solution.

The correct command to use is this (notice the addition --)

sudo npm run dev -- --tunnel-url https://<tunnel url>:<port>

The Documentation and shopify template app README.md needs to be updated.

View solution in original post

Reply 1 (1)

devenbryant
Shopify Partner
16 2 7

This is an accepted solution.

The correct command to use is this (notice the addition --)

sudo npm run dev -- --tunnel-url https://<tunnel url>:<port>

The Documentation and shopify template app README.md needs to be updated.