Closed
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
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
- Create a new blank Astro project.
- Install
@sentry/astro
anddrizzle-orm
. - Create a
src/middleware.ts
file. - Import any operator from
drizzle-orm
:
import { or } from 'drizzle-orm';
- Run the server and open the index page.
- Receive error:
MiddlewareCantBeLoaded
becausedrizzle-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)
Metadata
Metadata
Type
Projects
Status
No status