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
Type error with Remix+Vite and Express Server #9500
Or you might even want to completely omit wrapExpressCreateRequestHandler for dev because you wouldn't use Sentry for reporting errors during development
Thanks for the response.. I tried the second option of just not wrapping the handler in dev, but I am actually getting the exact same error in this scenario as well.
I just looked at our implementation, and it seems the most performance-efficient way to solve this is to await and extract the build before providing it to Sentry instrumentation. The whole async logic in this instrumentation is per-request, so there is currently no way to handle this without an API change or breaking performance.
I'm +1 to the first workaround that @na2hiro mentioned:
There's a workaround: await the vite server build. This might result in slower startup for dev, but there's no affect for Prod environment.
Or you might even want to completely omit wrapExpressCreateRequestHandler for dev because you wouldn't use Sentry for reporting errors during development
Activity
na2hiro commentedon Nov 10, 2023
This is caused by the extended type for
buildfield passed tocreateRequestHandler. It can now take a function which returns config object. remix-run/remix@9d516dd#diff-394afa15a85ef1282cf5f441ffbbf61c0a014a7bc9a4790be91ba004f1a21fb3R40There's a workaround: await the vite server build. This might result in slower startup for dev, but there's no affect for Prod environment.
wrapExpressCreateRequestHandler(createRequestHandler)({ build: vite - ? () => unstable_loadViteServerBuild(vite) + ? await unstable_loadViteServerBuild(vite) : await import(BUILD_DIR + "/index.js"), ... })Or you might even want to completely omit
wrapExpressCreateRequestHandlerfor dev because you wouldn't use Sentry for reporting errors during developmentstephen776 commentedon Nov 10, 2023
Thanks for the response.. I tried the second option of just not wrapping the handler in dev, but I am actually getting the exact same error in this scenario as well.
Lms24 commentedon Nov 10, 2023
Hi, thanks for reporting! We'll look into this soon.
@onurtemizkan please take a look at this after Hapi, thanks!
onurtemizkan commentedon Nov 15, 2023
I just looked at our implementation, and it seems the most performance-efficient way to solve this is to await and extract the build before providing it to Sentry instrumentation. The whole async logic in this instrumentation is per-request, so there is currently no way to handle this without an API change or breaking performance.
I'm +1 to the first workaround that @na2hiro mentioned:
We can mention it in the docs and also can automate this as a part of the wizard. Maybe a part of getsentry/sentry-wizard#495.
@Lms24 what do you think?
Lms24 commentedon Nov 15, 2023
Yes +1 on the first workaround, sounds good to me. RE wizard, yes but let's tackle it in a follow-up PR
saasc3l commentedon Jan 25, 2024
This now breaks Remix v2.5.x HDR.
Lms24 commentedon Jan 26, 2024
Hey @appist-engineering would you mind creating a new issue with a couple more details please? Thank you!
haines commentedon Feb 19, 2024
@Lms24 I've created a new issue following up on @appi5t's comment: #10724
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. (#…
feat(remix): Add Vite dev-mode support to Express instrumentation. (#…