solid-markdown icon indicating copy to clipboard operation
solid-markdown copied to clipboard

2.0.14 Not only doesn't render, but causes everything else to not render?

Open greglearns opened this issue 11 months ago • 4 comments

UPDATE: 2.0.14 has the error described below, but 2.0.13 works without any problems.

Ok, this is super strange.

I'm using the most recent version of SolidMarkdown and SolidJS, and followed the directions in the SolidMarkdown README to add this to an existing project of mine that is stable and known to work.

  1. When I use it the normal way, it doesn't render, and in fact, it causes all other Solid.js components to not render, even when I tried wrapping it in a SolidJS ErrorBoundary (not shown below).
// normal solid component code here...
return (
  <div>
     this will not be displayed if SolidMarkdown is uncommented below.
        {/*
        <SolidMarkdown children={"I've tried everything in this string and it will fail no matter what."} />
        */}
  </div>
)
  1. The other strange thing is that just referencing in a component will also cause that component and all other components to not render. E.g.:

// normal component code here...
try {
    const markdown = `
# This is a title

- here's
- a
- list
`;

    console.warn(
      "This will not be printed to the console if SolidMarkdown is included below.",
    );
    const boom = (
      <Suspense>
        {/*
        <SolidMarkdown children={markdown} />
        */}
        heeeee
      </Suspense>
    );
    console.warn(
      "This also will not be printed to the console if SolidMarkdown is included above.",
    );
  } catch (err) {
    console.warn(
      "This will not be printed to the console if SolidMarkdown is included above.",
    );
    console.warn("BOOM", err);
  }
  return <div>This will not render if SolidMarkdown is included above, even when it is included in a try/catch block</div>

greglearns avatar Jun 09 '25 23:06 greglearns

Hmm, I'm not getting this error in the demo I use to test the library Any other details you can share about your project setup? Is it using the latest solid-start, or a specific version of the solid vite plugin?

I recently added a server-side bundle to the output so it can be imported by people using solid-start SSR I'm willing to bet it's related to that but it's been working with the setups I tested

andi23rosca avatar Jun 21 '25 09:06 andi23rosca

I found that if there is a conditional path at the level above, the component stops rendering and everything that is nearby

import { useNavigate } from "@solidjs/router";
import { useAuth } from "clerk-solidjs";
import { createEffect, Suspense, type ParentComponent } from "solid-js";

const PrivateGroupLayout: ParentComponent = (props) => {
  const { isSignedIn, isLoaded } = useAuth();
  const navigate = useNavigate();
  createEffect(() => { 
    if (!isSignedIn() && isLoaded()) {
      navigate("/sign-in");
    }
  });
  return (
    <Suspense>{props.children}</Suspense>  // RENDERED
    // <Switch> // NOT RENDER
    //   <Match when={isSignedIn()}>
    //     <Suspense>{props.children}</Suspense>
    //   </Match>
    //   <Match when={!isSignedIn() && isLoaded()}>
    //     <Navigate href="/sign-in" />
    //   </Match>
    // </Switch>
  );
};
export default PrivateGroupLayout;

banolist avatar Aug 09 '25 19:08 banolist

I'm having a very similar issue with my website and tracked it down to updating solid-markdown.

I use Astro and if I update from 2.0.13 to 2.0.14, the website doesn't render and an error appear (unfortunately Astro makes it very hard to debug, as it has no stack trace whatsoever):

[astro-island] Error hydrating /src/Wes95/components/Explorer.tsx SyntaxError: Importing binding name 'default' cannot be resolved by star export entries.

This is only affecting pnpm dev using Vite, the production build seems to work correctly:

https://github.com/WesSouza/wes.dev/pull/111

WesSouza avatar Aug 20 '25 23:08 WesSouza

Same issue here. Adding this component instantly breaks the whole app

LoopControl avatar Oct 06 '25 20:10 LoopControl