diff --git a/src/platforms/javascript/guides/remix/manual-setup.mdx b/src/platforms/javascript/guides/remix/manual-setup.mdx index 32fb97c1e541b..e01b541638574 100644 --- a/src/platforms/javascript/guides/remix/manual-setup.mdx +++ b/src/platforms/javascript/guides/remix/manual-setup.mdx @@ -208,6 +208,17 @@ import { createRequestHandler } from "@remix-run/express"; const createSentryRequestHandler = wrapExpressCreateRequestHandler(createRequestHandler); -// Use createSentryRequestHandler like you would with createRequestHandler app.all("*", createSentryRequestHandler(/* ... */)); ``` + +The function returned by `wrapExpressCreateRequestHandler` accepts the build object as its first parameter. So if your boilerplate code passes the argument as a function, you need to update the usage. For example, if you're using Vite, you need to await the build loader before passing it to the wrapped handler. + +```diff {filename: server/index.ts} + wrapExpressCreateRequestHandler(createRequestHandler)({ + build: vite +- ? () => unstable_loadViteServerBuild(vite) ++ ? await unstable_loadViteServerBuild(vite) + : await import(BUILD_DIR + "/index.js"), + ... + }) +```