Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't run fast-cli #71

Closed
WDever opened this issue Dec 17, 2021 · 3 comments
Closed

Can't run fast-cli #71

WDever opened this issue Dec 17, 2021 · 3 comments

Comments

@WDever
Copy link

WDever commented Dec 17, 2021

Problem

I Installed fast-cli with yarn. And when I ran fast --upload, It caused an error.

Screen Shot 2021-12-18 at 2 21 42 AM

  ERROR  Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
        1. You might have mismatching versions of React and the renderer (such as React DOM)
        2. You might be breaking the Rules of Hooks
        3. You might have more than one copy of React in the same app
        See https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.

 - 1. You might have mismatching versions of React and the renderer (such as React DOM)
 - 2. You might be breaking the Rules of Hooks
 - 3. You might have more than one copy of React in the same app
 - See https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.
 - resolveDispatcher (/Users/wdever/.config/yarn/global/node_modules/react/cjs/react.development.js:1465:13)
 - useState (/Users/wdever/.config/yarn/global/node_modules/react/cjs/react.development.js:1496:20)
 - Fast (/Users/wdever/.config/yarn/global/node_modules/fast-cli/ui.js:104:29)
 - renderWithHooks (/Users/wdever/.config/yarn/global/node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js:6036:18)
 - mountIndeterminateComponent (/Users/wdever/.config/yarn/global/node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js:8570:13)
 - beginWork$1 (/Users/wdever/.config/yarn/global/node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js:9938:16)
 -Object.invokeGuardedCallbackImpl (/Users/wdever/.config/yarn/global/node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js:11563:
                                  10)
 - invokeGuardedCallback (/Users/wdever/.config/yarn/global/node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js:11740:31)
 - beginWork$$1 (/Users/wdever/.config/yarn/global/node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js:15778:7)
 - performUnitOfWork (/Users/wdever/.config/yarn/global/node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js:14696:12)

Reproduce

  1. instsall fast-cli with yarn global add fast-cli
  2. run fast --upload

Environment

  • node.js : v16.13.1
  • os : macOS 12.0.1 (But I met this bug when I'm using catalina)
  • package manager : yarn
@WDever WDever changed the title Can't fun fast-cli Can't run fast-cli Dec 17, 2021
@WDever
Copy link
Author

WDever commented Dec 17, 2021

I resolve this issue with remove old autarky package that was using old ink-text-input and ink. Now it run correctly!

@WDever WDever closed this as completed Dec 17, 2021
@WDever
Copy link
Author

WDever commented Dec 17, 2021

Hey, @sindresorhus .
I think the reason for this issue is that there is no package-lock.json or yarn.lock file.

When I cloned this repository and ran yarn install and run node cli.js, It ran without any bug.

But every time I ran fast --upload the bug occurred.

And there was an old package called autarky in the global that was using old ink. This Ink was using react@16.0.0

So I think that global installed fast-cli was using really old react that hook was not available.

package-lock.json or yarn.lock can solve this issue.

https://docs.npmjs.com/cli/v8/configuring-npm/package-lock-json

Can you add package-lock.json or yarn.lock ? Or, I'll create a Pull Request that include one of them.

THX!

@WDever WDever reopened this Dec 17, 2021
@sindresorhus
Copy link
Owner

This Ink was using react@16.0.0

That is then a bug with npm since the version in package.json is ^16.8.0

package-lock.json or yarn.lock can solve this issue.

It cannot. Lock files in packages are not used when installing them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants