#TypeError: sharedConfig.context.resources[id] is not an Object. (evaluating '"data" in sharedConfig.

15 messages · Page 1 of 1 (latest)

fluid pine
#

I am trying to port nextjs project o solidstart, love the way solid handles ssr, it's almost just work. But the reactivity system is a bit hard to get around because i am use to react way.

Error message: https://paste.cachyos.org/p/2aaae82.txt

According to error message it looks like something is wrong in ChatInput, but the problem is it keep crashing right away.

Component code: https://paste.cachyos.org/p/bbbe96c.txt

Using store mainly in order to control the chat input etc. Not sure what is causing the crash, but it happens when i populate the response from the chat.

upper plover
#

I see you are using bun.
Can you try to run the app with node to narrow it’s related to bun or something else.
Are you running the server with bunx —bun vinxi dev

#

Copied from solid start channel:

//package.json
//...
{
 "scripts": {
  "dev": "bunx --bun vinxi dev",
  "build": "bunx --bun vinxi build",
  "start": "bunx --bun vinxi start "
 },
}

//app.config.ts
export default defineConfig({
    //…
    server: {
        preset: "bun",
    },
});
fluid pine
#

yes I am

#
  vite: {
    plugins: [
      tailwindcss(),
      eslint(),
      devtools({
        autoname: true
      }),
    ],
    server: {
        preset: "bun",
    },
  },
});
{
  "name": "example-with-tailwindcss",
  "type": "module",
  "scripts": {
    "dev": "bunx --bun vinxi dev",
    "build": "bunx --bun vinxi build",
    "start": "bunx --bun vinxi start"
  },
#

let me run without bun

#

I have a question i am using store, but the response is undefined, so
chatStore.response?.messages
or
const messages = createMemo(() => chatStore.response?.messages)

#

and store is this
setResponse: (response) => setChatStore("response", response),

fluid pine
#

though using without bun helped, though I found out the issue my webpage become unresponsive

#
import { SolidMarkdown } from "solid-markdown";

export default function MarkdownRenderer(props: {
  content: string;
  role: string;
}) {
  return (
    <div class="flex items-start">
      <div
        class={`flex-1 wrap-break-word ${
          props.role === "user" && "whitespace-pre-wrap"
        }`}
      >
        <SolidMarkdown
          remarkPlugins={[remarkGfm]}
          class="napa-markdown"
          children={props.content}
        />
      </div>
    </div>
  );
}
#

this component is causin the issue for some reason

#

i tried importing it client only
Uncaught (in promise) SyntaxError: The requested module '/_build/node_modules/debug/src/browser.js?v=11361b1b' does not provide an export named 'default' (at create-tokenizer.js?v=11361b1b:40:8)

upper plover
#

Can you make a repro on stackblitz with example data?
If content is string this might happen.
Try

children={<>{props.content}</>}
(with Fragments)

#

And what did you import as clientOnly?
SolidMarkdown does not have a default export you need to add .SolidMarkdown at the end of the import.
Or you can always use a Show component and set a Boolean signal to true in onMount.

fluid pine
#

oh make sense