Skip to content

@sentry/astro breaks drizzle-orm in Astro #12912

Description

@laptou

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/astro

SDK Version

8.17.0

Framework Version

Astro 4.11.5

Link to Sentry event

No response

SDK Setup/Reproduction Example

https://stackblitz.com/edit/github-yligk2?file=astro.config.mjs

Steps to Reproduce

  1. Create a new blank Astro project.
  2. Install @sentry/astro and drizzle-orm.
  3. Create a src/middleware.ts file.
  4. Import any operator from drizzle-orm:
import { or } from 'drizzle-orm';
  1. Run the server and open the index page.
  2. Receive error: MiddlewareCantBeLoaded because drizzle-orm has no export "or".

Expected Result

Pages should load as normal even if the middleware depends on drizzle-orm.

Actual Result

 astro  v4.11.5 ready in 415 ms

┃ Local    http://localhost:4321/
┃ Network  use --host to expose

24:59:05 watching for file changes...
24:59:15 [ERROR] [MiddlewareCantBeLoaded] An unknown error was thrown while loading your middleware.
  Error reference:
    https://docs.astro.build/en/reference/errors/middleware-cant-be-loaded/
  Stack trace:
    at /home/ibiyemi/projects/personal/rdvz-web/node_modules/astro/dist/core/middleware/loadMiddleware.js:8:24
    [...] See full stack trace in the browser, or rerun with --verbose.
  Caused by:
  [vite] The requested module 'drizzle-orm' does not provide an export named 'or'
    at analyzeImportedModDifference (file:///home/ibiyemi/projects/personal/rdvz-web/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:52533:15)
    at async ssrImport (file:///home/ibiyemi/projects/personal/rdvz-web/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:53392:16)
    at async instantiateModule (file:///home/ibiyemi/projects/personal/rdvz-web/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:53451:5)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions