You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Can't instrument Remix server build with Express and Vite dev server #10724
Follow the Remix Vite migration guide with a custom Express app server. Specifically, use the Vite dev server in middleware mode and pass a function to createRequestHandler.
Sentry instruments the server build whether it is passed as a function or a static build. If the server build is a function, Sentry wraps the function and instruments the result when it is called.
TypeError: Cannot read properties of undefined (reading 'module')
at instrumentBuild (node_modules/.pnpm/@sentry+remix@7.101.1_@remix-run+node@2.6.0_@remix-run+react@2.6.0_react@18.2.0/node_modules/@sentry/src/utils/instrumentServer.ts:519:36)
at Object.<anonymous> (node_modules/.pnpm/@sentry+remix@7.101.1_@remix-run+node@2.6.0_@remix-run+react@2.6.0_react@18.2.0/node_modules/@sentry/src/utils/instrumentServer.ts:565:36)
at createRequestHandler (node_modules/.pnpm/@remix-run+express@2.6.0_express@4.18.2_typescript@5.3.3/node_modules/@remix-run/express/dist/server.js:36:28)
This was previously marked as resolved (#9500) by a workaround that was added to the docs where instead of passing the build as a function, you instead have to call the function and await the result. But as mentioned in this comment, that is not a good idea because it breaks HDR (the whole point of passing the function is that it is re-evaluated on every request, so that in dev you always get the latest server build after making changes, without having to reload the app server).
Reacted by mw10013, Kent C. Dodds, cayter and Rodolpho Bravo
Activity
lforst commentedon Feb 22, 2024
Hi, sorry for the late reply, we are taking a look at this!
feat(remix): Add Vite dev-mode support to Express instrumentation. (#…
AbhiPrasad commentedon Feb 26, 2024
we merged this fix in, but now have to backport this onto the v7 branch - so re-opening issue until release is cut there.
feat(remix): Add Vite dev-mode support to Express instrumentation. (#…
feat(remix): Add Vite dev-mode support to Express instrumentation. (#…
feat(remix): Add Vite dev-mode support to Express instrumentation. (#…
feat(remix): Add Vite dev-mode support to Express instrumentation. (#…
AbhiPrasad commentedon Mar 8, 2024
Fixed released with https://github.com/getsentry/sentry-javascript/releases/tag/7.106.0