Closed Vadorequest closed 3 years ago
This may be an upstream issue with withSentryConfig
.
There are few different interfaces for this next config (e.g. in particular, it could take in a function, or take in an object). If the upstream plugin isn't handling all of those cases, it could result in something not propagating correctly. I'll take a look!
Looking at their latest source code, I can confirm that @sentry/nextjs
is not handling the case when next.js config is a function.
compare that to next-plugin-preval
:
this explains why it works when withNextPluginPreval
is last and not vice versa. next-plugin-preval
always returns a function since it accepts one.
Thank you for taking such a quick look and idenfitying the issue! I'll forward this to them and close it here then!
I think there's something I can do about this though. I've heard similar issues from people using next-compose-plugins
with this lib so maybe I'm making some wrong assumptions. I'll open a separate issue for that.
Thanks for spotting that, @ricokahler. It's a known problem and is on our list to fix this sprint.
PR: https://github.com/UnlyEd/next-right-now/pull/370/files
http://localhost:8888/api/status
This is the expected behavior and that's what happens when not using
@sentry/nextjs
OR when usingwithNextPluginPreval
as top-level wrapper.module.exports = withNextPluginPreval(withSentryConfig(...
http://localhost:8888/api/status
This is what happens when using
module.exports = withSentryConfig(withNextPluginPreval(...
I'm not sure what's going wrong, but it drove me crazy for an hour. Since
@sentry/nextjs
explicitly stated to wrap all webpack config, I assumed it would be safe and didn't notice the regression right away.