solidjs/solid-site

Same code works in playground but doesn't in tutorial

Opened this issue · 0 comments

tysg commented

I was going through the tutorial of ErrorBoundary: https://www.solidjs.com/tutorial/flow_error_boundary but couldn't get ErrorBoundary to work. However the same code works in playground:

import { render } from "solid-js/web";
import { ErrorBoundary } from "solid-js";

const Broken = (props) => {
  throw new Error("Oh No");
  return <>Never Getting Here</>;
};

function App() {
  return (
    <>
      <div>Before</div>
      <ErrorBoundary fallback={(e) => <h2>Oh no! An Error!</h2>}>
        <Broken />
      </ErrorBoundary>
      <div>After</div>
    </>
  );
}

render(() => <App />, document.getElementById("app"));

I would love to help out with this issue; it would be really nice if anyone could point me a direction of the fix