Hello everyone,
I’m encountering an issue with the Assistant Playground where the page goes blank, and I can’t see any results or errors. This happens consistently, and I haven’t been able to find a workaround.
In the browser console, I see the following error message:
index--fsp2yqs.js:173 Uncaught
TypeError: Cannot read properties of undefined (reading 'replace')
at pre (index--fsp2yqs.js:173:112699)
at d7 (index--fsp2yqs.js:41:61543)
at HV (index--fsp2yqs.js:41:116676)
at FV (index--fsp2yqs.js:41:112391)
at A0e (index--fsp2yqs.js:41:112317)
at sw (index--fsp2yqs.js:41:112167)
at V5 (index--fsp2yqs.js:41:108526)
at NV (index--fsp2yqs.js:41:107473)
at T (index--fsp2yqs.js:33:1558)
at MessagePort.V (index--fsp2yqs.js:33:1921)
pre @ index--fsp2yqs.js:173
d7 @ index--fsp2yqs.js:41
HV @ index--fsp2yqs.js:41
FV @ index--fsp2yqs.js:41
A0e @ index--fsp2yqs.js:41
sw @ index--fsp2yqs.js:41
V5 @ index--fsp2yqs.js:41
NV @ index--fsp2yqs.js:41
T @ index--fsp2yqs.js:33
V @ index--fsp2yqs.js:33
After examining the code, I found that the problem is quite easy to solve. It simply needs to manage an edge case in this code where props.children
is undefined:
const r = t,
i = r.props.children.replace(/\s+$/, ""),
o = r.props.className ? (r.props.className.match(/language-(.*)$/) || [])[1] : "text";
return C.jsx(yit, {
value: i,
type: o,
...n
});
Has anyone else run into this problem or have any insights into what might be causing it? Any advice or solutions would be greatly appreciated!
Thanks in advance for your help.