question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: outputRange cannot include undefined, from useValues

See original GitHub issue

The code is giving error after using useValues

const [show, setShow] = useState(true);
const clock = useClock([]);
const startAnimation = new Value(1);
const [startTime, from, to] = useValues([0, 0, 0], []);
const endTime = add(startTime, duration);
const opacity = interpolate(clock, {
  inputRange: [startTime, endTime],
  outputRange: [from, to],
  extrapolate: Extrapolate.CLAMP,
});

Error: Invariant Violation: outputRange cannot be undefined

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
philipbulleycommented, Jun 16, 2020

I’ve just come across this too, reproduced here: https://snack.expo.io/@pbcodes/insane-scones

Changing the useValues([0, 0, 0, 0]) to useValues(0, 0, 0, 0) works. As @francosta said, the docs are out of date.

1reaction
CptFabulousocommented, May 21, 2020

It’s not changed in docs, but v14 change implementation. See here https://github.com/wcandillon/react-native-redash/releases/tag/v14.0.0 So you should have const [startTime, from, to] = useValues(0, 0, 0); From what I see in docs the useValues didn’t accept second parametr even before.

Read more comments on GitHub >

github_iconTop Results From Across the Web

invariant violation: outputRange cannot include #ffffff. (#ffffff ...
I get this error even I change: inputIndex ...
Read more >
Tutorial From Start React Native Website - Morioh
If I use useValues with an array, I get an error: outputRange cannot include undefined ,. const [startTime, from, to] = useValues(0, 0,...
Read more >
C++ Standard Library Unresolved Issues - open-std.org
It's not completely clear to me whether examples can be constructed that exhibit this problem, and don't have undefined behavior.
Read more >
MELSEC iQ-R Channel Isolated Digital-Analog Converter ...
CPU module cannot detect any error. To ensure safety operation in such a case, provide a safety mechanism or a fail-safe circuit external...
Read more >
C++ Standard Library Active Issues List
Provide a brief discussion of the problem you wish to correct. ... I can't find anything in section 27 that prohibits such values...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found