logger
logger copied to clipboard
SyntaxError: Unexpected token u in JSON at position 0 when using chaining operator in store.map
Versions
- effector: 22.2.0
- effector-logger: 0.13.4
- node: 14.19.1
Reproduction
Codesandbox (react + effector): https://codesandbox.io/s/serene-frog-rvcke7?file=/src/App.js
Steps to reproduce:
- Open sandbox repro
- Type some player name into input
- Click set player name
- Open console and you'll see this error:
SyntaxError: Unexpected token u in JSON at position 0
What is expected?
Error is not expected because when I'm using createStore
and createEvent
from 'effector' - there is no error.
Important
I observe this error only when using the chaining operator ?.
is store.map
. For example, if we change this line: const $playerName = $player.map((player) => player?.name);
to const $playerName = $player.map((player) => player ? player.name : null);
- there is no error