cli: [Bug]: Shopify CLI Raw Mode

Please confirm that you have:

  • Searched existing issues to see if your issue is a duplicate. (If you’ve found a duplicate issue, feel free to add additional information in a comment on it.)
  • Reproduced the issue in the latest CLI version.

In which of these areas are you experiencing a problem?

Extension

Expected behavior

The command npm run dev in Shopify CLI should push the draft version of the Theme App Extension along with the Shopify App to a development theme.

Actual behavior

The command initiates the start and push processes for both the app and the extension. It also generates the Dev Theme successfully, however, the process terminates with an error.

Verbose output

I will provide two versions of the output: the first will be the initial command, and the second will include the hint received from the first output.

First:
admin@admins-MBP app % npm run dev --verbose
npm verb cli /usr/local/bin/node /usr/local/bin/npm
npm info using npm@9.5.0
npm info using node@v18.15.0
npm verb title npm run dev
npm verb argv "run" "dev" "--loglevel" "verbose"
npm verb logfile logs-max:10 dir:/Users/user/.npm/_logs/2023-03-23T07_00_26_064Z-
npm verb logfile /Users/user/.npm/_logs/2023-03-23T07_00_26_064Z-debug-0.log
> app@1.0.0 dev
> shopify app dev
╭─ info ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                          │
│ Using your previous dev settings:                                                         │
│                                                                          │
│  • Org:     MyOrg                                                     │
│  • App:     app-test                                                            │
│  • Dev store:  project-dev.myshopify.com                                                    │
│  • Update URLs: Always                                                             │
│                                                                          │
│ To reset your default dev config, run `npm run dev -- --reset`                                          │
│                                                                          │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
whatever (Theme App Extension)
Follow the dev doc instructions ( https://shopify.dev/apps/online-store/theme-app-extensions/getting-started#step-3-test-your-changes ) by deploying your work as a draft
2023-03-23 07:00:42 | frontend  | npm
2023-03-23 07:00:42 | frontend  |  
2023-03-23 07:00:42 | backend  | npm
2023-03-23 07:00:42 | backend  |  verb cli /usr/local/bin/node /usr/local/bin/npm
2023-03-23 07:00:42 | backend  | npm info using npm@9.5.0
2023-03-23 07:00:42 | backend  | npm info using node@v18.15.0
2023-03-23 07:00:42 | backend  | npm verb title npm run dev
2023-03-23 07:00:42 | backend  | npm verb argv "run" "dev"
2023-03-23 07:00:42 | backend  | npm verb logfile logs-max:10 dir:/Users/user/.npm/_logs/2023-03-23T07_00_42_590Z-
2023-03-23 07:00:42 | frontend  | verb cli /usr/local/bin/node /usr/local/bin/npm
2023-03-23 07:00:42 | frontend  | npm info using npm@9.5.0
2023-03-23 07:00:42 | frontend  | npm info using node@v18.15.0
2023-03-23 07:00:42 | frontend  | npm verb title npm run dev
2023-03-23 07:00:42 | frontend  | npm verb argv "run" "dev"
2023-03-23 07:00:42 | frontend  | npm verb logfile logs-max:10 dir:/Users/user/.npm/_logs/2023-03-23T07_00_42_560Z-
2023-03-23 07:00:42 | frontend  | npm verb logfile /Users/user/.npm/_logs/2023-03-23T07_00_42_560Z-debug-0.log
2023-03-23 07:00:42 | frontend  |
2023-03-23 07:00:42 | frontend  | > dev
2023-03-23 07:00:42 | frontend  | > vite
2023-03-23 07:00:42 | frontend  |
2023-03-23 07:00:42 | backend  | npm verb logfile /Users/user/.npm/_logs/2023-03-23T07_00_42_590Z-debug-0.log
2023-03-23 07:00:42 | backend  |
2023-03-23 07:00:42 | backend  | > dev
2023-03-23 07:00:42 | backend  | > cross-env NODE_ENV=development nodemon index.js --ignore ./frontend
2023-03-23 07:00:42 | backend  |
2023-03-23 07:00:43 | backend  | [nodemon] 2.0.21
2023-03-23 07:00:43 | backend  | [nodemon] to restart at any time, enter `rs`
2023-03-23 07:00:43 | backend  | [nodemon] watching path(s): *.*
2023-03-23 07:00:43 | backend  | [nodemon] watching extensions: js,mjs,json
2023-03-23 07:00:43 | backend  | [nodemon] starting `node index.js`
2023-03-23 07:00:44 | frontend  |
2023-03-23 07:00:44 | frontend  |  vite v2.9.15 dev server running at:
2023-03-23 07:00:44 | frontend  |
2023-03-23 07:00:44 | frontend  |  > Local:  http://localhost:50185/
2023-03-23 07:00:44 | frontend  |  > Network: http://192.168.1.96:50185/
2023-03-23 07:00:44 | frontend  |
2023-03-23 07:00:44 | frontend  |  ready in 1281ms.
2023-03-23 07:00:44 | frontend  |
2023-03-23 07:00:44 | backend  | [shopify-api/INFO] version 6.2.0, environment Node v18.15.0
                                                                                                                  
 Press `p` to open your browser. Press `q` to quit.                                                                                        
                                                                                                                  
Preview URL: https://d01-195-222-106-138.eu.ngrok.io?shop=project-dev.myshopify.com&host=YXF1cmF0ZS1kZXYubXlzaG9waWZ5LmNvbS9hZG1pbg
✗ An unexpected error occurred.
    To submit an issue include the stack trace.
    To print the stack trace, add the environment variable SHOPIFY_CLI_STACKTRACE=1.
? Send an anonymized error report to Shopify? (Choose with ↑ ↓ ⏎, filter with 'f')
> 1. Yes, send
 2. No, don't send
Traceback (most recent call last):
    11: from /Users/user/app/node_modules/@shopify/cli-kit/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/error_handler.rb:71:in `block in install!'
    10: from /Users/user/app/node_modules/@shopify/cli-kit/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/error_handler.rb:31:in `handle_exception'
     9: from /Users/user/app/node_modules/@shopify/cli-kit/assets/cli-ruby/lib/shopify_cli/exception_reporter.rb:26:in `report'
     8: from /Users/user/app/node_modules/@shopify/cli-kit/assets/cli-ruby/lib/shopify_cli/exception_reporter.rb:57:in `report?'
     7: from /Users/user/app/node_modules/@shopify/cli-kit/assets/cli-ruby/lib/shopify_cli/exception_reporter.rb:68:in `report_error?'
     6: from /Users/user/app/node_modules/@shopify/cli-kit/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/prompt.rb:100:in `ask'
     5: from /Users/user/app/node_modules/@shopify/cli-kit/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/prompt.rb:203:in `ask_interactive'
     4: from /Users/user/app/node_modules/@shopify/cli-kit/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/prompt.rb:230:in `interactive_prompt'
     3: from /Users/user/app/node_modules/@shopify/cli-kit/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/prompt/interactive_options.rb:27:in `call'
     2: from /Users/user/app/node_modules/@shopify/cli-kit/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/prompt/interactive_options.rb:74:in `call'
     1: from /Users/user/app/node_modules/@shopify/cli-kit/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/prompt/interactive_options.rb:246:in `process_input_until_redraw_required'
/Users/user/app/node_modules/@shopify/cli-kit/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/prompt/interactive_options.rb:256:in `wait_for_user_input': Interrupt (Interrupt)
npm verb exit 1
npm verb code 1

Second:
admin@admins-MBP app % SHOPIFY_CLI_STACKTRACE=1 | npm run dev --verbose
npm verb cli /usr/local/bin/node /usr/local/bin/npm
npm info using npm@9.5.0
npm info using node@v18.15.0
npm verb title npm run dev
npm verb argv "run" "dev" "--loglevel" "verbose"
npm verb logfile logs-max:10 dir:/Users/user/.npm/_logs/2023-03-23T07_01_30_649Z-
npm verb logfile /Users/user/.npm/_logs/2023-03-23T07_01_30_649Z-debug-0.log
> app@1.0.0 dev
> shopify app dev
╭─ info ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                          │
│ Using your previous dev settings:                                                         │
│                                                                          │
│  • Org:     MyOrg                                                     │
│  • App:     app-test                                                            │
│  • Dev store:  project-dev.myshopify.com                                                    │
│  • Update URLs: Always                                                             │
│                                                                          │
│ To reset your default dev config, run `npm run dev -- --reset`                                          │
│                                                                          │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
whatever (Theme App Extension)
Follow the dev doc instructions ( https://shopify.dev/apps/online-store/theme-app-extensions/getting-started#step-3-test-your-changes ) by deploying your work as a draft
  ERROR  Raw mode is not supported on the current process.stdin, which Ink uses as input stream by default.
    Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported
 - Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported
 - App.handleSetRawMode (node_modules/ink/build/components/App.js:56:27)
 -  (node_modules/ink/build/hooks/use-input.js:38:9)
 - invokePassiveEffectCreate (node_modules/react-reconciler/cjs/react-reconciler.development.js:16054:20)
 - Object.invokeGuardedCallbackProd (node_modules/react-reconciler/cjs/react-reconciler.development.js:12101:10)
 - invokeGuardedCallback (node_modules/react-reconciler/cjs/react-reconciler.development.js:12292:31)
 - flushPassiveEffectsImpl (node_modules/react-reconciler/cjs/react-reconciler.development.js:16141:9)
 - unstable_runWithPriority (node_modules/scheduler/cjs/scheduler.development.js:468:12)
 - runWithPriority (node_modules/react-reconciler/cjs/react-reconciler.development.js:2495:10)
 - flushPassiveEffects (node_modules/react-reconciler/cjs/react-reconciler.development.js:16014:14)
 -  (node_modules/react-reconciler/cjs/react-reconciler.development.js:15891:11)
╭─ error ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                          │
│ Raw mode is not supported on the current process.stdin, which Ink uses as input stream by default.                        │
│ Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported                          │
│                                                                          │
│ To investigate the issue, examine this stack trace:                                                │
│  at handleSetRawMode (ink/build/components/App.js:56)                                              │
│   throw new Error('Raw mode is not supported on the current process.stdin, which Ink uses as input stream by default.\nRead about how to     │
│   prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported');                               │
│  at (ink/build/hooks/use-input.js:38)                                                      │
│   setRawMode(true);                                                               │
│  at invokePassiveEffectCreate (react-reconciler/cjs/react-reconciler.development.js:16054)                            │
│   effect.destroy = create();                                                          │
│  at invokeGuardedCallbackProd (react-reconciler/cjs/react-reconciler.development.js:12101)                            │
│   func.apply(context, funcArgs);                                                        │
│  at invokeGuardedCallback (react-reconciler/cjs/react-reconciler.development.js:12292)                              │
│   invokeGuardedCallbackImpl$1.apply(reporter, arguments);                                            │
│  at flushPassiveEffectsImpl (react-reconciler/cjs/react-reconciler.development.js:16141)                             │
│   invokeGuardedCallback(null, invokePassiveEffectCreate, null, _effect2);                                    │
│  at unstable_runWithPriority (scheduler/cjs/scheduler.development.js:468)                                    │
│   return eventHandler();                                                            │
│  at runWithPriority (react-reconciler/cjs/react-reconciler.development.js:2495)                                 │
│   return Scheduler_runWithPriority(priorityLevel, fn);                                             │
│  at flushPassiveEffects (react-reconciler/cjs/react-reconciler.development.js:16014)                               │
│   return runWithPriority(priorityLevel, flushPassiveEffectsImpl);                                        │
│  at (react-reconciler/cjs/react-reconciler.development.js:15891)                                         │
│   flushPassiveEffects();                                                            │
│                                                                          │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
npm verb exit 1
npm verb code 1

Reproduction steps

  1. npm init @shopify/app@latest
  2. cd app
  3. npm run shopify app generate extension
  4. npm run dev

Operating System

macOS Monterey, 12.6.3

Shopify CLI version (check your project’s package.json if you’re not sure)

3.44.1

Shell

zsh

Node version (run node -v if you’re not sure)

v18.15.0

What language and version are you using in your application?

Node v18.15.0

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 6
  • Comments: 18 (8 by maintainers)

Most upvoted comments

Need to let npm know the flag is for deploy rather than npm itself.

npm run shopify app deploy -- -f

Running it with -f does the same.

Run npm run shopify app deploy -f
npm WARN using --force Recommended protections disabled.

> shopify
> shopify app deploy


The above error occurred in the <SelectPrompt> component:

    at SelectPrompt (file:///home/runner/work/.../node_modules/@shopify/cli-kit/dist/private/node/ui/components/SelectPrompt.js:12:25)
    at App (file:///home/runner/work/.../node_modules/ink/build/components/App.js:18:9)

  ERROR Raw mode is not supported on the current process.stdin, which Ink uses
React will try to recreate this component tree from scratch using the error boundary you provided, InternalApp.
       as input stream by default.
       Read about how to prevent this error on
       https://github.com/vadimdemedes/ink/#israwmodesupported

It didn’t like it.

Run SHOPIFY_CLI_STACKTRACE=1 npm run shopify app deploy -- --verbose
SHOPIFY_CLI_STACKTRACE=1: /home/runner/work/_temp/9201a291-a3ee-4c76-8721-26112f4fa0a0.ps1:2
Line |
   2 |  SHOPIFY_CLI_STACKTRACE=1 npm run shopify app deploy -- --verbose
     |  ~~~~~~~~~~~~~~~~~~~~~~~~
     | The term 'SHOPIFY_CLI_STACKTRACE=1' is not recognized as a name of a
     | cmdlet, function, script file, or executable program. Check the spelling
     | of the name, or if a path was included, verify that the path is correct
     | and try again.

Error: Process completed with exit code 1.

The problem is that I’m trying to deploy GH actions, and the cli cannot use Ink.

name: App Extensions - Stage

on:
  push:
    branches:
      - stage

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
      - uses: actions/setup-node@v3
        with:
          node-version: 18
          cache: 'npm'
      - name: Install NPM dependencies
        run: npm install
      - name: Deploy
        shell: pwsh
        env:
          SHOPIFY_CLI_PARTNERS_TOKEN: ${{ secrets.SHOPIFY_CLI_PARTNERS_TOKEN }}
          SHOPIFY_API_KEY: ${{ secrets.STAGE_SHOPIFY_API_KEY }}
          SHOPIFY_PRODUCT_ALLOWANCES_ID: ${{ secrets.STAGE_SHOPIFY_PRODUCT_ALLOWANCES_ID }}
        run: npm run shopify app deploy

The error is

> shopify app deploy


  ERROR Raw mode is not supported on the current process.stdin, which Ink uses
       as input stream by default.
       Read about how to prevent this error on
       https://github.com/vadimdemedes/ink/#israwmodesupported
The above error occurred in the <SelectPrompt> component:

    at SelectPrompt (file:///home/runner/work/.../node_modules/@shopify/cli-kit/dist/private/node/ui/components/SelectPrompt.js:12:25)
    at App (file:///home/runner/work/.../node_modules/ink/build/components/App.js:18:9)

True. That worked. Thank you  @amcaplan!

Same error here

I have the same issue.