Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update artifact component #1007

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Toddyclipsgg
Copy link

@Toddyclipsgg Toddyclipsgg commented Jan 5, 2025

@Toddyclipsgg
Copy link
Author

Toddyclipsgg commented Jan 5, 2025

@wonderwhy-er @thecodacus @mrsimpson Take a look to see if everything is ok!

const actions = useStore(
computed(artifact.runner.actions, (actions) => {
computed(artifact?.runner?.actions ?? [], (actions) => {
return Object.values(actions);
}),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think you can remove this check

// Early return if no artifact exists
  if (!artifact) {
    return null;
  }

since you are already null checking in line 42

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and add a block before the return statement, otherwise react will not like it when the hooks are being called inconsistently

// Early return if no artifact exists
  if (!artifact) {
    return <></>;
  }

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll try here, I don't know anything about programming hahaha

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this part itself generates several problems, what do you think I should do?

// Early return if no artifact exists
if (!artifact) {
return null;
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have made the changes see if this works

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the console error:

4 Artifact.tsx:38 Uncaught TypeError: Cannot convert undefined or null to object
at Object.values ()
at Artifact.tsx:38:21
at set (chunk-SSLESP6V.js?v=50f5e49b:312:19)
at chunk-SSLESP6V.js?v=50f5e49b:332:5
at listener (chunk-SSLESP6V.js?v=50f5e49b:264:19)
at object.events..reduceRight.shared (chunk-SSLESP6V.js?v=50f5e49b:174:58)
at Array.reduceRight ()
at chunk-SSLESP6V.js?v=50f5e49b:174:31
at $store.listen (chunk-SSLESP6V.js?v=50f5e49b:272:9)
at Object.get (chunk-SSLESP6V.js?v=50f5e49b:77:15)
(anônimo) @ Artifact.tsx:38
set @ chunk-SSLESP6V.js?v=50f5e49b:312
(anônimo) @ chunk-SSLESP6V.js?v=50f5e49b:332
listener @ chunk-SSLESP6V.js?v=50f5e49b:264
object.events..reduceRight.shared @ chunk-SSLESP6V.js?v=50f5e49b:174
(anônimo) @ chunk-SSLESP6V.js?v=50f5e49b:174
$store.listen @ chunk-SSLESP6V.js?v=50f5e49b:272
get @ chunk-SSLESP6V.js?v=50f5e49b:77
mountSyncExternalStore @ chunk-RMBP4JJR.js?v=50f5e49b:18764
useSyncExternalStore @ chunk-RMBP4JJR.js?v=50f5e49b:19451
useSyncExternalStore @ chunk-MMYKBDYJ.js?v=50f5e49b:1405
useStore @ @nanostores_react.js?v=50f5e49b:32
(anônimo) @ Artifact.tsx:36
renderWithHooks @ chunk-RMBP4JJR.js?v=50f5e49b:18426
updateFunctionComponent @ chunk-RMBP4JJR.js?v=50f5e49b:21460
updateSimpleMemoComponent @ chunk-RMBP4JJR.js?v=50f5e49b:21341
updateMemoComponent @ chunk-RMBP4JJR.js?v=50f5e49b:21244
beginWork @ chunk-RMBP4JJR.js?v=50f5e49b:22855
callCallback2 @ chunk-RMBP4JJR.js?v=50f5e49b:10552
invokeGuardedCallbackDev @ chunk-RMBP4JJR.js?v=50f5e49b:10577
invokeGuardedCallback @ chunk-RMBP4JJR.js?v=50f5e49b:10611
beginWork$1 @ chunk-RMBP4JJR.js?v=50f5e49b:26643
performUnitOfWork @ chunk-RMBP4JJR.js?v=50f5e49b:26076
workLoopSync @ chunk-RMBP4JJR.js?v=50f5e49b:26015
renderRootSync @ chunk-RMBP4JJR.js?v=50f5e49b:25994
recoverFromConcurrentError @ chunk-RMBP4JJR.js?v=50f5e49b:25614
performConcurrentWorkOnRoot @ chunk-RMBP4JJR.js?v=50f5e49b:25562
workLoop @ chunk-RMBP4JJR.js?v=50f5e49b:462
flushWork @ chunk-RMBP4JJR.js?v=50f5e49b:441
performWorkUntilDeadline @ chunk-RMBP4JJR.js?v=50f5e49b:649Entenda o erroAI
chunk-SCWIOAUD.js?v=50f5e49b:2942 TypeError: Cannot convert undefined or null to object
at Object.values ()
at Artifact.tsx:38:21
at set (chunk-SSLESP6V.js?v=50f5e49b:312:19)
at chunk-SSLESP6V.js?v=50f5e49b:332:5
at listener (chunk-SSLESP6V.js?v=50f5e49b:264:19)
at object.events..reduceRight.shared (chunk-SSLESP6V.js?v=50f5e49b:174:58)
at Array.reduceRight ()
at chunk-SSLESP6V.js?v=50f5e49b:174:31
at $store.listen (chunk-SSLESP6V.js?v=50f5e49b:272:9)
at Object.get (chunk-SSLESP6V.js?v=50f5e49b:77:15)
RemixRootDefaultErrorBoundary @ chunk-SCWIOAUD.js?v=50f5e49b:2942
renderWithHooks @ chunk-RMBP4JJR.js?v=50f5e49b:18426
mountIndeterminateComponent @ chunk-RMBP4JJR.js?v=50f5e49b:21804
beginWork @ chunk-RMBP4JJR.js?v=50f5e49b:22792
beginWork$1 @ chunk-RMBP4JJR.js?v=50f5e49b:26631
performUnitOfWork @ chunk-RMBP4JJR.js?v=50f5e49b:26076
workLoopSync @ chunk-RMBP4JJR.js?v=50f5e49b:26015
renderRootSync @ chunk-RMBP4JJR.js?v=50f5e49b:25994
recoverFromConcurrentError @ chunk-RMBP4JJR.js?v=50f5e49b:25614
performConcurrentWorkOnRoot @ chunk-RMBP4JJR.js?v=50f5e49b:25562
workLoop @ chunk-RMBP4JJR.js?v=50f5e49b:462
flushWork @ chunk-RMBP4JJR.js?v=50f5e49b:441
performWorkUntilDeadline @ chunk-RMBP4JJR.js?v=50f5e49b:649Entenda o erroAI
chunk-RMBP4JJR.js?v=50f5e49b:20910 The above error occurred in one of your React components:

at http://localhost:5174/app/components/chat/Artifact.tsx:27:3
at div (http://localhost:5174/app/components/chat/Markdown.tsx:27:9)
at div
at div (http://localhost:5174/app/components/chat/Markdown.tsx:27:9)
at div
at div (http://localhost:5174/app/components/chat/Markdown.tsx:27:9)
at Markdown (http://localhost:5174/node_modules/.vite/deps/react-markdown.js?v=50f5e49b:5840:35)
at http://localhost:5174/app/components/chat/Markdown.tsx:18:3
at div
at _c (http://localhost:5174/app/components/chat/AssistantMessage.tsx:11:3)
at div
at div
at div
at http://localhost:5174/app/components/chat/Messages.client.tsx:21:5
at ClientOnly (http://localhost:5174/node_modules/.vite/deps/remix-utils_client-only.js?v=50f5e49b:38:23)
at div
at div
at div
at div
at Provider (http://localhost:5174/node_modules/.vite/deps/chunk-6KZQL2HW.js?v=50f5e49b:86:15)
at TooltipProvider (http://localhost:5174/node_modules/.vite/deps/@radix-ui_react-tooltip.js?v=50f5e49b:98:5)
at http://localhost:5174/app/components/chat/BaseChat.tsx:36:3
at http://localhost:5174/app/components/chat/Chat.client.tsx:138:16
at Chat (http://localhost:5174/app/components/chat/Chat.client.tsx:43:7)
at ClientOnly (http://localhost:5174/node_modules/.vite/deps/remix-utils_client-only.js?v=50f5e49b:38:23)
at div
at Index
at RenderedRoute (http://localhost:5174/node_modules/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:413:5)
at Outlet (http://localhost:5174/node_modules/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:781:26)
at Layout (http://localhost:5174/app/root.tsx:99:3)
at App (http://localhost:5174/app/root.tsx:129:17)
at Layout (http://localhost:5174/app/root.tsx:99:3)
at RenderedRoute (http://localhost:5174/node_modules/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:413:5)
at RenderErrorBoundary (http://localhost:5174/node_modules/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:373:5)
at DataRoutes (http://localhost:5174/node_modules/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:1435:5)
at Router (http://localhost:5174/node_modules/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:788:15)
at RouterProvider (http://localhost:5174/node_modules/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:1249:5)
at RemixErrorBoundary (http://localhost:5174/node_modules/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:2904:5)
at RemixBrowser (http://localhost:5174/node_modules/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:4458:46)

React will try to recreate this component tree from scratch using the error boundary you provided, RenderErrorBoundary.
logCapturedError @ chunk-RMBP4JJR.js?v=50f5e49b:20910
callback @ chunk-RMBP4JJR.js?v=50f5e49b:20956
callCallback @ chunk-RMBP4JJR.js?v=50f5e49b:18126
commitUpdateQueue @ chunk-RMBP4JJR.js?v=50f5e49b:18143
commitLayoutEffectOnFiber @ chunk-RMBP4JJR.js?v=50f5e49b:23953
commitLayoutMountEffects_complete @ chunk-RMBP4JJR.js?v=50f5e49b:24858
commitLayoutEffects_begin @ chunk-RMBP4JJR.js?v=50f5e49b:24847
commitLayoutEffects @ chunk-RMBP4JJR.js?v=50f5e49b:24798
commitRootImpl @ chunk-RMBP4JJR.js?v=50f5e49b:26231
commitRoot @ chunk-RMBP4JJR.js?v=50f5e49b:26155
finishConcurrentRender @ chunk-RMBP4JJR.js?v=50f5e49b:25638
performConcurrentWorkOnRoot @ chunk-RMBP4JJR.js?v=50f5e49b:25596
workLoop @ chunk-RMBP4JJR.js?v=50f5e49b:462
flushWork @ chunk-RMBP4JJR.js?v=50f5e49b:441
performWorkUntilDeadline @ chunk-RMBP4JJR.js?v=50f5e49b:649Entenda o erroAI
chunk-SCWIOAUD.js?v=50f5e49b:400 React Router caught the following error during render TypeError: Cannot convert undefined or null to object
at Object.values ()
at Artifact.tsx:38:21
at set (chunk-SSLESP6V.js?v=50f5e49b:312:19)
at chunk-SSLESP6V.js?v=50f5e49b:332:5
at listener (chunk-SSLESP6V.js?v=50f5e49b:264:19)
at object.events..reduceRight.shared (chunk-SSLESP6V.js?v=50f5e49b:174:58)
at Array.reduceRight ()
at chunk-SSLESP6V.js?v=50f5e49b:174:31
at $store.listen (chunk-SSLESP6V.js?v=50f5e49b:272:9)
at Object.get (chunk-SSLESP6V.js?v=50f5e49b:77:15) {componentStack: '\n at http://localhost:5174/app/components/chat/…/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:4458:46)'}
componentDidCatch @ chunk-SCWIOAUD.js?v=50f5e49b:400
callback @ chunk-RMBP4JJR.js?v=50f5e49b:20962
callCallback @ chunk-RMBP4JJR.js?v=50f5e49b:18126
commitUpdateQueue @ chunk-RMBP4JJR.js?v=50f5e49b:18143
commitLayoutEffectOnFiber @ chunk-RMBP4JJR.js?v=50f5e49b:23953
commitLayoutMountEffects_complete @ chunk-RMBP4JJR.js?v=50f5e49b:24858
commitLayoutEffects_begin @ chunk-RMBP4JJR.js?v=50f5e49b:24847
commitLayoutEffects @ chunk-RMBP4JJR.js?v=50f5e49b:24798
commitRootImpl @ chunk-RMBP4JJR.js?v=50f5e49b:26231
commitRoot @ chunk-RMBP4JJR.js?v=50f5e49b:26155
finishConcurrentRender @ chunk-RMBP4JJR.js?v=50f5e49b:25638
performConcurrentWorkOnRoot @ chunk-RMBP4JJR.js?v=50f5e49b:25596
workLoop @ chunk-RMBP4JJR.js?v=50f5e49b:462
flushWork @ chunk-RMBP4JJR.js?v=50f5e49b:441
performWorkUntilDeadline @ chunk-RMBP4JJR.js?v=50f5e49b:649Entenda o erroAI
chunk-RMBP4JJR.js?v=50f5e49b:20910 The above error occurred in one of your React components:

at http://localhost:5174/app/components/chat/Artifact.tsx:27:3
at div (http://localhost:5174/app/components/chat/Markdown.tsx:27:9)
at div
at div (http://localhost:5174/app/components/chat/Markdown.tsx:27:9)
at div
at div (http://localhost:5174/app/components/chat/Markdown.tsx:27:9)
at Markdown (http://localhost:5174/node_modules/.vite/deps/react-markdown.js?v=50f5e49b:5840:35)
at http://localhost:5174/app/components/chat/Markdown.tsx:18:3
at div
at _c (http://localhost:5174/app/components/chat/AssistantMessage.tsx:11:3)
at div
at div
at div
at http://localhost:5174/app/components/chat/Messages.client.tsx:21:5
at ClientOnly (http://localhost:5174/node_modules/.vite/deps/remix-utils_client-only.js?v=50f5e49b:38:23)
at div
at div
at div
at div
at Provider (http://localhost:5174/node_modules/.vite/deps/chunk-6KZQL2HW.js?v=50f5e49b:86:15)
at TooltipProvider (http://localhost:5174/node_modules/.vite/deps/@radix-ui_react-tooltip.js?v=50f5e49b:98:5)
at http://localhost:5174/app/components/chat/BaseChat.tsx:36:3
at http://localhost:5174/app/components/chat/Chat.client.tsx:138:16
at Chat (http://localhost:5174/app/components/chat/Chat.client.tsx:43:7)
at ClientOnly (http://localhost:5174/node_modules/.vite/deps/remix-utils_client-only.js?v=50f5e49b:38:23)
at div
at Index
at RenderedRoute (http://localhost:5174/node_modules/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:413:5)
at Outlet (http://localhost:5174/node_modules/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:781:26)
at Layout (http://localhost:5174/app/root.tsx:99:3)
at App (http://localhost:5174/app/root.tsx:129:17)
at Layout (http://localhost:5174/app/root.tsx:99:3)
at RenderedRoute (http://localhost:5174/node_modules/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:413:5)
at RenderErrorBoundary (http://localhost:5174/node_modules/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:373:5)
at DataRoutes (http://localhost:5174/node_modules/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:1435:5)
at Router (http://localhost:5174/node_modules/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:788:15)
at RouterProvider (http://localhost:5174/node_modules/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:1249:5)
at RemixErrorBoundary (http://localhost:5174/node_modules/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:2904:5)
at RemixBrowser (http://localhost:5174/node_modules/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:4458:46)

React will try to recreate this component tree from scratch using the error boundary you provided, RenderErrorBoundary.
logCapturedError @ chunk-RMBP4JJR.js?v=50f5e49b:20910
callback @ chunk-RMBP4JJR.js?v=50f5e49b:20956
callCallback @ chunk-RMBP4JJR.js?v=50f5e49b:18126
commitUpdateQueue @ chunk-RMBP4JJR.js?v=50f5e49b:18143
commitLayoutEffectOnFiber @ chunk-RMBP4JJR.js?v=50f5e49b:23953
commitLayoutMountEffects_complete @ chunk-RMBP4JJR.js?v=50f5e49b:24858
commitLayoutEffects_begin @ chunk-RMBP4JJR.js?v=50f5e49b:24847
commitLayoutEffects @ chunk-RMBP4JJR.js?v=50f5e49b:24798
commitRootImpl @ chunk-RMBP4JJR.js?v=50f5e49b:26231
commitRoot @ chunk-RMBP4JJR.js?v=50f5e49b:26155
finishConcurrentRender @ chunk-RMBP4JJR.js?v=50f5e49b:25638
performConcurrentWorkOnRoot @ chunk-RMBP4JJR.js?v=50f5e49b:25596
workLoop @ chunk-RMBP4JJR.js?v=50f5e49b:462
flushWork @ chunk-RMBP4JJR.js?v=50f5e49b:441
performWorkUntilDeadline @ chunk-RMBP4JJR.js?v=50f5e49b:649Entenda o erroAI
chunk-SCWIOAUD.js?v=50f5e49b:400 React Router caught the following error during render TypeError: Cannot convert undefined or null to object
at Object.values ()
at Artifact.tsx:38:21
at set (chunk-SSLESP6V.js?v=50f5e49b:312:19)
at chunk-SSLESP6V.js?v=50f5e49b:332:5
at listener (chunk-SSLESP6V.js?v=50f5e49b:264:19)
at object.events..reduceRight.shared (chunk-SSLESP6V.js?v=50f5e49b:174:58)
at Array.reduceRight ()
at chunk-SSLESP6V.js?v=50f5e49b:174:31
at $store.listen (chunk-SSLESP6V.js?v=50f5e49b:272:9)
at Object.get (chunk-SSLESP6V.js?v=50f5e49b:77:15) {componentStack: '\n at http://localhost:5174/app/components/chat/…/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:4458:46)'}
componentDidCatch @ chunk-SCWIOAUD.js?v=50f5e49b:400
callback @ chunk-RMBP4JJR.js?v=50f5e49b:20962
callCallback @ chunk-RMBP4JJR.js?v=50f5e49b:18126
commitUpdateQueue @ chunk-RMBP4JJR.js?v=50f5e49b:18143
commitLayoutEffectOnFiber @ chunk-RMBP4JJR.js?v=50f5e49b:23953
commitLayoutMountEffects_complete @ chunk-RMBP4JJR.js?v=50f5e49b:24858
commitLayoutEffects_begin @ chunk-RMBP4JJR.js?v=50f5e49b:24847
commitLayoutEffects @ chunk-RMBP4JJR.js?v=50f5e49b:24798
commitRootImpl @ chunk-RMBP4JJR.js?v=50f5e49b:26231
commitRoot @ chunk-RMBP4JJR.js?v=50f5e49b:26155
finishConcurrentRender @ chunk-RMBP4JJR.js?v=50f5e49b:25638
performConcurrentWorkOnRoot @ chunk-RMBP4JJR.js?v=50f5e49b:25596
workLoop @ chunk-RMBP4JJR.js?v=50f5e49b:462
flushWork @ chunk-RMBP4JJR.js?v=50f5e49b:441
performWorkUntilDeadline @ chunk-RMBP4JJR.js?v=50f5e49b:649Entenda o erroAI
chunk-RMBP4JJR.js?v=50f5e49b:20910 The above error occurred in one of your React components:

at http://localhost:5174/app/components/chat/Artifact.tsx:27:3
at div (http://localhost:5174/app/components/chat/Markdown.tsx:27:9)
at div
at div (http://localhost:5174/app/components/chat/Markdown.tsx:27:9)
at div
at div (http://localhost:5174/app/components/chat/Markdown.tsx:27:9)
at Markdown (http://localhost:5174/node_modules/.vite/deps/react-markdown.js?v=50f5e49b:5840:35)
at http://localhost:5174/app/components/chat/Markdown.tsx:18:3
at div
at _c (http://localhost:5174/app/components/chat/AssistantMessage.tsx:11:3)
at div
at div
at div
at http://localhost:5174/app/components/chat/Messages.client.tsx:21:5
at ClientOnly (http://localhost:5174/node_modules/.vite/deps/remix-utils_client-only.js?v=50f5e49b:38:23)
at div
at div
at div
at div
at Provider (http://localhost:5174/node_modules/.vite/deps/chunk-6KZQL2HW.js?v=50f5e49b:86:15)
at TooltipProvider (http://localhost:5174/node_modules/.vite/deps/@radix-ui_react-tooltip.js?v=50f5e49b:98:5)
at http://localhost:5174/app/components/chat/BaseChat.tsx:36:3
at http://localhost:5174/app/components/chat/Chat.client.tsx:138:16
at Chat (http://localhost:5174/app/components/chat/Chat.client.tsx:43:7)
at ClientOnly (http://localhost:5174/node_modules/.vite/deps/remix-utils_client-only.js?v=50f5e49b:38:23)
at div
at Index
at RenderedRoute (http://localhost:5174/node_modules/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:413:5)
at Outlet (http://localhost:5174/node_modules/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:781:26)
at Layout (http://localhost:5174/app/root.tsx:99:3)
at App (http://localhost:5174/app/root.tsx:129:17)
at Layout (http://localhost:5174/app/root.tsx:99:3)
at RenderedRoute (http://localhost:5174/node_modules/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:413:5)
at RenderErrorBoundary (http://localhost:5174/node_modules/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:373:5)
at DataRoutes (http://localhost:5174/node_modules/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:1435:5)
at Router (http://localhost:5174/node_modules/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:788:15)
at RouterProvider (http://localhost:5174/node_modules/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:1249:5)
at RemixErrorBoundary (http://localhost:5174/node_modules/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:2904:5)
at RemixBrowser (http://localhost:5174/node_modules/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:4458:46)

React will try to recreate this component tree from scratch using the error boundary you provided, RenderErrorBoundary.
logCapturedError @ chunk-RMBP4JJR.js?v=50f5e49b:20910
callback @ chunk-RMBP4JJR.js?v=50f5e49b:20956
callCallback @ chunk-RMBP4JJR.js?v=50f5e49b:18126
commitUpdateQueue @ chunk-RMBP4JJR.js?v=50f5e49b:18143
commitLayoutEffectOnFiber @ chunk-RMBP4JJR.js?v=50f5e49b:23953
commitLayoutMountEffects_complete @ chunk-RMBP4JJR.js?v=50f5e49b:24858
commitLayoutEffects_begin @ chunk-RMBP4JJR.js?v=50f5e49b:24847
commitLayoutEffects @ chunk-RMBP4JJR.js?v=50f5e49b:24798
commitRootImpl @ chunk-RMBP4JJR.js?v=50f5e49b:26231
commitRoot @ chunk-RMBP4JJR.js?v=50f5e49b:26155
finishConcurrentRender @ chunk-RMBP4JJR.js?v=50f5e49b:25638
performConcurrentWorkOnRoot @ chunk-RMBP4JJR.js?v=50f5e49b:25596
workLoop @ chunk-RMBP4JJR.js?v=50f5e49b:462
flushWork @ chunk-RMBP4JJR.js?v=50f5e49b:441
performWorkUntilDeadline @ chunk-RMBP4JJR.js?v=50f5e49b:649Entenda o erroAI
chunk-SCWIOAUD.js?v=50f5e49b:400 React Router caught the following error during render TypeError: Cannot convert undefined or null to object
at Object.values ()
at Artifact.tsx:38:21
at set (chunk-SSLESP6V.js?v=50f5e49b:312:19)
at chunk-SSLESP6V.js?v=50f5e49b:332:5
at listener (chunk-SSLESP6V.js?v=50f5e49b:264:19)
at object.events..reduceRight.shared (chunk-SSLESP6V.js?v=50f5e49b:174:58)
at Array.reduceRight ()
at chunk-SSLESP6V.js?v=50f5e49b:174:31
at $store.listen (chunk-SSLESP6V.js?v=50f5e49b:272:9)
at Object.get (chunk-SSLESP6V.js?v=50f5e49b:77:15) {componentStack: '\n at http://localhost:5174/app/components/chat/…/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:4458:46)'}
componentDidCatch @ chunk-SCWIOAUD.js?v=50f5e49b:400
callback @ chunk-RMBP4JJR.js?v=50f5e49b:20962
callCallback @ chunk-RMBP4JJR.js?v=50f5e49b:18126
commitUpdateQueue @ chunk-RMBP4JJR.js?v=50f5e49b:18143
commitLayoutEffectOnFiber @ chunk-RMBP4JJR.js?v=50f5e49b:23953
commitLayoutMountEffects_complete @ chunk-RMBP4JJR.js?v=50f5e49b:24858
commitLayoutEffects_begin @ chunk-RMBP4JJR.js?v=50f5e49b:24847
commitLayoutEffects @ chunk-RMBP4JJR.js?v=50f5e49b:24798
commitRootImpl @ chunk-RMBP4JJR.js?v=50f5e49b:26231
commitRoot @ chunk-RMBP4JJR.js?v=50f5e49b:26155
finishConcurrentRender @ chunk-RMBP4JJR.js?v=50f5e49b:25638
performConcurrentWorkOnRoot @ chunk-RMBP4JJR.js?v=50f5e49b:25596
workLoop @ chunk-RMBP4JJR.js?v=50f5e49b:462
flushWork @ chunk-RMBP4JJR.js?v=50f5e49b:441
performWorkUntilDeadline @ chunk-RMBP4JJR.js?v=50f5e49b:649Entenda o erroAI
chunk-RMBP4JJR.js?v=50f5e49b:20910 The above error occurred in one of your React components:

at http://localhost:5174/app/components/chat/Artifact.tsx:27:3
at div (http://localhost:5174/app/components/chat/Markdown.tsx:27:9)
at li
at ul
at div
at div (http://localhost:5174/app/components/chat/Markdown.tsx:27:9)
at div
at div (http://localhost:5174/app/components/chat/Markdown.tsx:27:9)
at Markdown (http://localhost:5174/node_modules/.vite/deps/react-markdown.js?v=50f5e49b:5840:35)
at http://localhost:5174/app/components/chat/Markdown.tsx:18:3
at div
at _c (http://localhost:5174/app/components/chat/AssistantMessage.tsx:11:3)
at div
at div
at div
at http://localhost:5174/app/components/chat/Messages.client.tsx:21:5
at ClientOnly (http://localhost:5174/node_modules/.vite/deps/remix-utils_client-only.js?v=50f5e49b:38:23)
at div
at div
at div
at div
at Provider (http://localhost:5174/node_modules/.vite/deps/chunk-6KZQL2HW.js?v=50f5e49b:86:15)
at TooltipProvider (http://localhost:5174/node_modules/.vite/deps/@radix-ui_react-tooltip.js?v=50f5e49b:98:5)
at http://localhost:5174/app/components/chat/BaseChat.tsx:36:3
at http://localhost:5174/app/components/chat/Chat.client.tsx:138:16
at Chat (http://localhost:5174/app/components/chat/Chat.client.tsx:43:7)
at ClientOnly (http://localhost:5174/node_modules/.vite/deps/remix-utils_client-only.js?v=50f5e49b:38:23)
at div
at Index
at RenderedRoute (http://localhost:5174/node_modules/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:413:5)
at Outlet (http://localhost:5174/node_modules/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:781:26)
at Layout (http://localhost:5174/app/root.tsx:99:3)
at App (http://localhost:5174/app/root.tsx:129:17)
at Layout (http://localhost:5174/app/root.tsx:99:3)
at RenderedRoute (http://localhost:5174/node_modules/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:413:5)
at RenderErrorBoundary (http://localhost:5174/node_modules/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:373:5)
at DataRoutes (http://localhost:5174/node_modules/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:1435:5)
at Router (http://localhost:5174/node_modules/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:788:15)
at RouterProvider (http://localhost:5174/node_modules/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:1249:5)
at RemixErrorBoundary (http://localhost:5174/node_modules/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:2904:5)
at RemixBrowser (http://localhost:5174/node_modules/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:4458:46)

React will try to recreate this component tree from scratch using the error boundary you provided, RenderErrorBoundary.
logCapturedError @ chunk-RMBP4JJR.js?v=50f5e49b:20910
callback @ chunk-RMBP4JJR.js?v=50f5e49b:20956
callCallback @ chunk-RMBP4JJR.js?v=50f5e49b:18126
commitUpdateQueue @ chunk-RMBP4JJR.js?v=50f5e49b:18143
commitLayoutEffectOnFiber @ chunk-RMBP4JJR.js?v=50f5e49b:23953
commitLayoutMountEffects_complete @ chunk-RMBP4JJR.js?v=50f5e49b:24858
commitLayoutEffects_begin @ chunk-RMBP4JJR.js?v=50f5e49b:24847
commitLayoutEffects @ chunk-RMBP4JJR.js?v=50f5e49b:24798
commitRootImpl @ chunk-RMBP4JJR.js?v=50f5e49b:26231
commitRoot @ chunk-RMBP4JJR.js?v=50f5e49b:26155
finishConcurrentRender @ chunk-RMBP4JJR.js?v=50f5e49b:25638
performConcurrentWorkOnRoot @ chunk-RMBP4JJR.js?v=50f5e49b:25596
workLoop @ chunk-RMBP4JJR.js?v=50f5e49b:462
flushWork @ chunk-RMBP4JJR.js?v=50f5e49b:441
performWorkUntilDeadline @ chunk-RMBP4JJR.js?v=50f5e49b:649Entenda o erroAI
chunk-SCWIOAUD.js?v=50f5e49b:400 React Router caught the following error during render TypeError: Cannot convert undefined or null to object
at Object.values ()
at Artifact.tsx:38:21
at set (chunk-SSLESP6V.js?v=50f5e49b:312:19)
at chunk-SSLESP6V.js?v=50f5e49b:332:5
at listener (chunk-SSLESP6V.js?v=50f5e49b:264:19)
at object.events..reduceRight.shared (chunk-SSLESP6V.js?v=50f5e49b:174:58)
at Array.reduceRight ()
at chunk-SSLESP6V.js?v=50f5e49b:174:31
at $store.listen (chunk-SSLESP6V.js?v=50f5e49b:272:9)
at Object.get (chunk-SSLESP6V.js?v=50f5e49b:77:15) {componentStack: '\n at http://localhost:5174/app/components/chat/…/.vite/deps/chunk-SCWIOAUD.js?v=50f5e49b:4458:46)'}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it, can you try one more time

@Toddyclipsgg
Copy link
Author

If you tell me that you are betting, I can help you try to solve the problem better, even though I don't know anything, I am very hard-working and persistent in solving problems until I solve them correctly. If you give me some tips, I would also like to learn more about programming. Thanks @thecodacus!

@thecodacus
Copy link
Collaborator

the error that you pasted suggested the Object.values is throwing error as actions object is not present.
so I have added a check to only use Object.values if actions is present and return a empty list otherwise.

I am not able to replicate the issue from my side, so I am relying on you to test the changes. can you check the last change ?

@Toddyclipsgg
Copy link
Author

Yes, I can do it, but it will have to be tomorrow after work here it's already 5 o'clock in the morning.

@wonderwhy-er
Copy link
Collaborator

I actually got this error today when importing a github repo
I can replicate it here
https://bolt.myaibuilt.app/git?url=https://github.com/wonderwhy-er/bolt.myaibuilt.app_hosted-Bolt.New-oTToDev

After git import it shows bolt ui with empty messages and then crashes

@thecodacus
Copy link
Collaborator

@wonderwhy-er this is breaking cuz the url is not a .git url and the content has boltArtifact tags in it
maybe we can add a check where it will see if the url is a git url or not

@Toddyclipsgg
Copy link
Author

The problem happens regardless of whether there is .git in the link.

@thecodacus
Copy link
Collaborator

you cannot import bolt.diy in bolt.diy. it wont work as of now

@thecodacus
Copy link
Collaborator

@Toddyclipsgg @wonderwhy-er, raised a PR for importing bolt in bolt #1020

@Toddyclipsgg
Copy link
Author

I wasn't trying to import bolt into bolt, it was just an example, the error happened with any repository link.

@Toddyclipsgg
Copy link
Author

And what can I help you with? @thecodacus

@thecodacus
Copy link
Collaborator

thecodacus commented Jan 7, 2025

I wasn't trying to import bolt into bolt, it was just an example, the error happened with any repository link.

in the video you shared you copied wrong link.

the repo link has to be git repo link not github page link
check the below image below
image

if you still face any issue share the repo you are trying to import that is causing the issue, I will investigate

@Toddyclipsgg
Copy link
Author

Toddyclipsgg commented Jan 7, 2025

You are very good man, it was perfect for me. Can I close this PR? @thecodacus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants