Closed kaaloo closed 1 year ago
Thanks for the report! Will take a look.
@kaaloo Do you have a reproduction? I tried creating a test case for this, it seems to work correctly.
Output:
var valueAtom = useMemo(
function () {
return atom({
value: value,
});
},
[value]
);
valueAtom.debugLabel = "valueAtom";
I'll close due to inactivity. Feel free to re-open :)
@Thisen Sorry, I did not see your reply on this case. The issue comes up when using the debug label plugin. See:
https://jotai.org/docs/tools/swc#swc-jotai-debug-label
Your test case thus should not set the debug label because the purpose of the debug label plugin is to set it automatically through a code transform.
This type of pattern will cause an error because although it will not be possible to deduce a
debugLabel
for the atom, the pattern is not skipped.The workaround is to use a slightly more verbose form where the transform can do it's job.