microsoft / inshellisense

IDE style command line auto complete
MIT License
8.24k stars 181 forks source link

Parse error near `__inshellisense #24

Closed zhelenskiy closed 8 months ago

zhelenskiy commented 8 months ago

Describe the bug The app fails with .inshellisense/key-bindings.zsh:10: parse error near `__inshellisense' when I open terminal after the installation.

To Reproduce Steps to reproduce the behavior:

  1. Install the app on Mac M2 Pro
  2. Open new terminal
  3. Get the message.
  4. Inshellisense does not work.

Expected behavior Everything works fine

Environment

Additional context

is -s zsh

  ERROR  pagedSuggestions.at is not a function

 file:///opt/homebrew/lib/node_modules/@microsoft/inshellisense/build/ui/sugges
 tions.js:48:48

 -Suggestion (file:///opt/homebrew/lib/node_modules/@microsoft/inshellisense/bu
            ild/ui/suggestions.js:48:48)
 -renderWithHo (/opt/homebrew/lib/node_modules/@microsoft/inshellisense/node_mo
  ks          dules/react-reconciler/cjs/react-reconciler.development.js:7478:1
              8)
 -mountIndeterminateCo (/opt/homebrew/lib/node_modules/@microsoft/inshellisense
  ponent              /node_modules/react-reconciler/cjs/react-reconciler.devel
                      opment.js:11247:13)
 -beginWor (/opt/homebrew/lib/node_modules/@microsoft/inshellisense/node_module
          s/react-reconciler/cjs/react-reconciler.development.js:12760:16)
 -beginWork$ (/opt/homebrew/lib/node_modules/@microsoft/inshellisense/node_modu
            les/react-reconciler/cjs/react-reconciler.development.js:19569:14)

 -performUnitOfW (/opt/homebrew/lib/node_modules/@microsoft/inshellisense/node_
  rk            modules/react-reconciler/cjs/react-reconciler.development.js:18
                703:12)
 -workLoopSy (/opt/homebrew/lib/node_modules/@microsoft/inshellisense/node_modu
  c         les/react-reconciler/cjs/react-reconciler.development.js:18609:5)
 -renderRootSy (/opt/homebrew/lib/node_modules/@microsoft/inshellisense/node_mo
  c           dules/react-reconciler/cjs/react-reconciler.development.js:18577:
              7)
 -performSyncWorkO (/opt/homebrew/lib/node_modules/@microsoft/inshellisense/nod
  Root            e_modules/react-reconciler/cjs/react-reconciler.development.j
                  s:18193:20)
 -flushSyncCallb (/opt/homebrew/lib/node_modules/@microsoft/inshellisense/node_
  cks           modules/react-reconciler/cjs/react-reconciler.development.js:29
                36:22)

  ERROR  pagedSuggestions.at is not a function

 file:///opt/homebrew/lib/node_modules/@microsoft/inshellisense/build/ui/sugges
 tions.js:48:48

 -Suggestion (file:///opt/homebrew/lib/node_modules/@microsoft/inshellisense/bu
            ild/ui/suggestions.js:48:48)
 -renderWithHo (/opt/homebrew/lib/node_modules/@microsoft/inshellisense/node_mo
  ks          dules/react-reconciler/cjs/react-reconciler.development.js:7478:1
              8)
 -mountIndeterminateCo (/opt/homebrew/lib/node_modules/@microsoft/inshellisense
  ponent              /node_modules/react-reconciler/cjs/react-reconciler.devel
                      opment.js:11247:13)
 -beginWor (/opt/homebrew/lib/node_modules/@microsoft/inshellisense/node_module
          s/react-reconciler/cjs/react-reconciler.development.js:12760:16)
 -beginWork$ (/opt/homebrew/lib/node_modules/@microsoft/inshellisense/node_modu
            les/react-reconciler/cjs/react-reconciler.development.js:19569:14)

 -performUnitOfW (/opt/homebrew/lib/node_modules/@microsoft/inshellisense/node_
  rk            modules/react-reconciler/cjs/react-reconciler.development.js:18
                703:12)
 -workLoopSy (/opt/homebrew/lib/node_modules/@microsoft/inshellisense/node_modu
  c         les/react-reconciler/cjs/react-reconciler.development.js:18609:5)
 -renderRootSy (/opt/homebrew/lib/node_modules/@microsoft/inshellisense/node_mo
  c           dules/react-reconciler/cjs/react-reconciler.development.js:18577:
              7)
 -performSyncWorkO (/opt/homebrew/lib/node_modules/@microsoft/inshellisense/nod
  Root            e_modules/react-reconciler/cjs/react-reconciler.development.j
                  s:18193:20)
 -flushSyncCallb (/opt/homebrew/lib/node_modules/@microsoft/inshellisense/node_
  cks           modules/react-reconciler/cjs/react-reconciler.development.js:29
                36:22)
The above error occurred in the <Suggestions> component:

    at Suggestions (file:///opt/homebrew/lib/node_modules/@microsoft/inshellisense/build/ui/suggestions.js:42:39)
    at ink-box
    at file:///opt/homebrew/lib/node_modules/@microsoft/inshellisense/node_modules/ink/build/components/Box.js:5:27
    at UI (file:///opt/homebrew/lib/node_modules/@microsoft/inshellisense/build/ui/ui-root.js:11:15)
    at App (file:///opt/homebrew/lib/node_modules/@microsoft/inshellisense/node_modules/ink/build/components/App.js:19:9)

React will try to recreate this component tree from scratch using the error boundary you provided, InternalApp.
cpendery commented 8 months ago

This might be a combination of both node version && CRLF issues. See #16 for the parsing error as this is a duplicate of that. Which node version are you using @zhelenskiy?

zhelenskiy commented 8 months ago

@cpendery mentioned it in the description: 16.0.0.

cpendery commented 8 months ago

@zhelenskiy, can you try again with 0.0.1-rc.3 once it gets published to npm?

zhelenskiy commented 8 months ago

The same

image
cpendery commented 8 months ago

The same image

@zhelenskiy you try running the is uninstall command to clear the key bindings and then create a fresh binding for zsh via is bind. It may still have left over CRLFs from the first time you created the binding

zhelenskiy commented 8 months ago

Ok, now it doesn't show anything in the new terminal, but it also does nothing at all. I use iTerm by the way.

cpendery commented 8 months ago

Great, so you can start a new inshellisense session by running ^A or via running is -s zsh. It won't start one for you automatically on shell start

zhelenskiy commented 8 months ago

It still doesn't work.

image
cpendery commented 8 months ago

You'll need at least node 16.6.0 & higher based on Mozilla's docs for the .at function. This is the same issue as #14.