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

No error events reported by SolidStart SDK #15242

Open
3 tasks done
rodolfoBee opened this issue Jan 31, 2025 · 2 comments
Open
3 tasks done

No error events reported by SolidStart SDK #15242

rodolfoBee opened this issue Jan 31, 2025 · 2 comments
Labels
Package: solidstart Issues related to the Sentry SolidStart SDK

Comments

@rodolfoBee
Copy link
Member

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/solidstart

SDK Version

8.52.1

Framework Version

Solidstart 1.0.11

Link to Sentry event

No response

Reproduction Example/SDK Setup

No response

Steps to Reproduce

  1. Create a new solidstart app npm init solid@latest
  2. Enable drizzle on the project setup
  3. Add Sentry as per: https://docs.sentry.io/platforms/javascript/guides/solidstart/
  4. Add a manual throw or an unhandled error somewhere in the code to test Sentry
  5. Run the app (dev or prod mode)

Expected Result

The app to run correctly and the error to be visible in Sentry

Actual Result

First, drizzle is breaks. to fix it the user needs to add the following to the init in instrument.server.mjs

registerEsmLoaderHooks: { onlyIncludeInstrumentedModules: true }

The error:

[vite] Error when evaluating SSR module /src/api/server.ts: failed to import "drizzle-orm"
|- SyntaxError: [vite] The requested module 'drizzle-orm' does not provide an export named 'eq'
    at analyzeImportedModDifference ([ROOT_PATH]/solidstart/solidSentry/node_modules/vite/dist/node/chunks/dep-BWSbWtLw.js:52053:15)
    at nodeImport ([ROOT_PATH]/solidstart/solidSentry/node_modules/vite/dist/node/chunks/dep-BWSbWtLw.js:53060:5)
    at async ssrImport ([ROOT_PATH]/solidstart/solidSentry/node_modules/vite/dist/node/chunks/dep-BWSbWtLw.js:52914:16)
    at async eval ([ROOT_PATH]/solidstart/solidSentry/src/api/server.ts:6:31)
    at async instantiateModule ([ROOT_PATH]/solidstart/solidSentry/node_modules/vite/dist/node/chunks/dep-BWSbWtLw.js:52972:5)

After that, no unhandled errors are sent to Sentry. Only manual errors with captureException are reported.

Transactions are reported as expected.

The issue is also reported in this Discord thread.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Jan 31, 2025
@github-actions github-actions bot added the Package: solidstart Issues related to the Sentry SolidStart SDK label Jan 31, 2025
@andreiborza
Copy link
Member

Will take a look, thanks for filing here.

@andreiborza
Copy link
Member

The SolidStart SDK cannot currently handle these errors. We'll have to spend more time investigating but in the meantime, to get errors reported in your API you can wrap server actions with withServerActionInstrumentation like so:

export async function loginOrRegister(formData: FormData) {
  return withServerActionInstrumentation('loginOrRegister', async () => {
    ...
    throw new Error('Error from loginOrRegister')
...

This isn't yet documented anywhere and it's not the nicest experience but it should at least catch errors in here, it'll also create an instrumentation span for your server action.

For catching errors in routes, you could wrap your app in an error boundary: https://docs.sentry.io/platforms/javascript/guides/solidstart/features/error-boundary/

Just bandaids until we figure out a way to report truly uncaught errors. Hope this helps a bit.

@andreiborza andreiborza assigned s1gr1d and unassigned s1gr1d Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: solidstart Issues related to the Sentry SolidStart SDK
Projects
Status: No status
Development

No branches or pull requests

3 participants