-
Notifications
You must be signed in to change notification settings - Fork 65
middleware not running in production #823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
turns out if we move the above |
Hey @chrisdrackett, thanks for reporting that issue! This is weird and I cannot reproduce locally. Importing your middleware file into the entrypoint is indeed the way to go here. I tried reproducing your setup and it works. Could you maybe share a reproduction repo, or make sure you're using the latest |
@Weakky sure, here is a test app: https://github.com/chrisdrackett/nexus-middleware-test Locally I see |
Ah, I see. So this is not technically a bug, although it sucks. The reason why your middleware isn't working in dev nor prod is because your This problem should be gone once #833 is merged. In the meantime, you can solve that problem by replacing |
note that this does work in dev, just not production. Thanks for the info! |
Sorry, the suggested change works for us! I was just noting that before the change things worked locally for us :) |
Was this issue related to
🤔 |
Hi @chrisdrackett, what does the middleware from Sentry look like? Can you share a snippet? |
this is what we currently have:
|
That’s quick😃 Thanks so much! |
We've added a couple bits of middleware to our app. One for logging requests and one for capturing errors and sending them to sentry. Both of these work in development without issue, but as far as we can tell both are not running in production. Here is an example:
middleware/index.ts
this is then just imported in
app.ts
Are we doing something wrong here?
The text was updated successfully, but these errors were encountered: