privatenumber / snap-tweet

Snap a screenshot of a tweet 📸
MIT License
333 stars 19 forks source link

Not working, crashing. #1

Closed mlunax closed 3 years ago

mlunax commented 3 years ago

Bug description

What did you expect to happen?

Make the snap of the tweet.

What happened instead?

Crashlog

  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://reactjs.org/link/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://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.
 - resolveDispatcher (.npm/_npx/924bde91603cbfe8/node_modules/snap-tweet/node_modules/react/cjs/react.development.js:1476:13)
 - useReducer (.npm/_npx/924bde91603cbfe8/node_modules/snap-tweet/node_modules/react/cjs/react.development.js:1511:20)
 -  (.npm/_npx/924bde91603cbfe8/node_modules/snap-tweet/dist/chunk-TXU6FXSL.js:2635:49)
 - renderWithHooks (.npm/_npx/924bde91603cbfe8/node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js:6036:18)
 - mountIndeterminateComponent (.npm/_npx/924bde91603cbfe8/node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js:8570:13)
 - beginWork$1 (.npm/_npx/924bde91603cbfe8/node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js:9938:16)
 - Object.invokeGuardedCallbackImpl (.npm/_npx/924bde91603cbfe8/node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js:11563:10)
 - invokeGuardedCallback (.npm/_npx/924bde91603cbfe8/node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js:11740:31)
 - beginWork$$1 (.npm/_npx/924bde91603cbfe8/node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js:15778:7)
 - performUnitOfWork (.npm/_npx/924bde91603cbfe8/node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js:14696:12)

Reproduction

Run the npx snap-tweet with public tweet url and no options.

Environment

snap-tweet/0.0.0-semantic-release linux-x64 node-v16.1.0

privatenumber commented 3 years ago

Thanks for your report @mlunax

Hmm interesting... I just verified it works on a new Macbook that never had snap-tweet installed using:

npx snap-tweet https://twitter.com/jack/status/20

Do you mind sharing more details about your OS environment? I admit I developed this on a Mac so I've only tested it on a Mac.

If there's a linux distribution I can download and open in a VM to test, let me know.

I will also look into adding tests across different operating systems.

sng-conga commented 3 years ago

I was able to recreate when using node-v16.1.0, i tried other node version v15^ or v14^ and had no issues.

privatenumber commented 3 years ago

Ah I'm able to reproduce now. Thanks for pointing out

privatenumber commented 3 years ago

Confirmed fixed in 1.0.1:

npx snap-tweet@1.0.1 https://twitter.com/jack/status/20