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

TypeError: ErrorBoundary is not a constructor #5

Open
dimitrilahaye opened this issue Apr 18, 2021 · 1 comment
Open

TypeError: ErrorBoundary is not a constructor #5

dimitrilahaye opened this issue Apr 18, 2021 · 1 comment

Comments

@dimitrilahaye
Copy link

Hello, I'm using Svelte 3 and have this error while testing App component:

TypeError: ErrorBoundary is not a constructor

Here my App Component:

<script>
  import ErrorBoundary from 'svelte-error-boundary'
  import TailwindCSS from './style/TailwindCSS.svelte';
  import * as Sentry from "@sentry/browser";
  import {Integrations} from "@sentry/tracing";
  import BrokenComponent from "./BrokenComponent.svelte";

  export let name;
  let handleError = (e) => {
    Sentry.captureException(e);
  }

  Sentry.init({
    dsn: process.env.SENTRYURL,
    integrations: [new Integrations.BrowserTracing()],
    tracesSampleRate: process.env.SENTRYTRACES,
  });
</script>

<TailwindCSS />
<ErrorBoundary {handleError}>
  <BrokenComponent/>
  <main>
    <h1 class="text-3xl font-bold">Hello {name}!</h1>
    <p>
      Visit the
      <a href="https://svelte.dev/tutorial">Svelte tutorial</a>
      or the <a href="https://tailwindcss.com/docs">Tailwind CSS docs</a>
      to learn how to build apps!
    </p>
  </main>
</ErrorBoundary>

<style>
  main {
    @apply p-4;
  }
  h1,
  p {
    @apply text-gray-600;
  }
  a {
    @apply text-blue-600 underline;
  }
</style>

Then my BrockenComponent:

<script>
    let a;
    let b = a.c;
</script>

Do you have an idea of what happens?

@khromov
Copy link

khromov commented Jan 4, 2022

@dimitrilahaye A bit late to the party but I think you are importing the package svelte-error-boundary as opposed to @crownframework/svelte-error-boundary. They are different packages despite the same name, so check the docs for the relevant package!

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

No branches or pull requests

2 participants