-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
@sentry/nextjs
7.15
and 7.16
have issues with @vercel/nft
#5998
@sentry/nextjs
7.15
and 7.16
have issues with @vercel/nft
#5998
Comments
Hi, thanks for reporting this and providing a ton of information. I am able to reproduce this. The We did something somewhat risky with this feature and issues like these just simply didn't come up during development - sorry for the inconvenience! If you figure out any workarounds or have solutions in mind, let us know! We'll try to find a fix. |
Thanks @lforst! Setting Happy to try out new ideas Sentry team comes up with 👍 |
My team is also experiencing this same issue. Trying the Edit: as per @kachkaev |
@kachkaev - Echoing @lforst here: Thanks for such a thorough writeup and investigation! It's not entirely clear yet, but fixing this may mean trying to contribute an upstream patch to the nft package. I'm going to dive into it for a bit and see what I can figure out, then ping vercel folks in a few days once they're no longer actively in the middle of their nextjs conference. UPDATE 1: Checked out the nft files you linked and ugh - the problem is actually worse than I realized. Yes, UPDATE 2: Okay, question 1 solved. The 7.13/7.14 versions have no sentry files because the API route isn't using Oy. Okay. Time to clone the nft repo! 🙂 |
I think we're running into a similar issue here, except with a different package. |
@alechartung - Sorry, I'm not sure what you mean. This issue is specifically about the nft files missing dependencies from the page files we wrap. How does |
Maybe it's not the same exact issue and just has the same workaround, then. |
Yes, it turns out there are any number of ways for the autowrapping to not play nicely with other packages. Would you please file a separate issue and give the details of the error you’re running into? |
Appreciate the thorough write-up, @kachkaev 👍 We're running into the same issue. Trying to Have forked the MWE repo, upgraded Our current workaround is to use its new const moduleExports = {
sentry: {
excludeServerRoutes: ['/api/hello']
}
} |
I have a PR open in the nft repo to fix the underlying cause of this problem. Until that's merged, if you use |
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which package are you using?
@sentry/nextjs
SDK Version
7.15.0 / 7.16.0
Framework Version
Next 12.3.1
Link to Sentry event
No response
Steps to Reproduce
When upgrading blockprotocol/blockprotocol from
@sentry/[email protected]
to7.15.0
or7.16.0
, my app started responding with 500 on Vercel. It was working fine locally, which did not make sense at first. I managed to link this problem to@vercel/nft
(part of Next.js) and created an MWE here:https://github.com/hasharchives/sentry-vercel-nft-issue/branches/all
The bug it is to do with Sentry corrupting
*.nft.json
build files.The default
no-sentry
branch in my MWE contains a simple Next.js app that consists of a page withgetServerSideProps
and an API route. Both files readdata.json
in the repo root. When the app is built, Next creates.next/server/pages/**/*.nft.json
files which are then used on Vercel to determine which files to include in which lambdas. These files are normally.gitignore
-ed but I’ve added them to the MWE repo:no-sentry
.next/server/pages/index.js.nft.jsonno-sentry
.next/server/pages/api/hello.js.nft.jsonAutogenerated
*.nft.json
files are one-liners. I ranyarn dlx prettier --write .next/server/pages/**/*.nft.json
and then ordered file paths alphabetically to ease comparison.As you can see, both files above refer
data.json
which is correct.Installing
@sentry/[email protected]
or@sentry/[email protected]
results in more items in*.nft.json
but does not affect the presence ofdata.json
– that’s good:sentry-7.13
.next/server/pages/index.js.nft.jsonsentry-7.13
.next/server/pages/api/hello.js.nft.jsonsentry-7.14
.next/server/pages/index.js.nft.jsonsentry-7.14
.next/server/pages/api/hello.js.nft.jsonHowever, switching to newer versions of
@sentry/nextjs
causesdata.json
to disappear:sentry-7.15
.next/server/pages/index.js.nft.jsonsentry-7.15
.next/server/pages/api/hello.js.nft.jsonsentry-7.16
.next/server/pages/index.js.nft.jsonsentry-7.16
.next/server/pages/api/hello.js.nft.jsonAlthough the result of
next build
works locally viayarn start
, the Vercel deployment ends up corrupt because of the missing references. Lambda logs show this:Expected Result
data.json
is included in*.nft.json
files for all tested@sentry/nextjs
versions.Actual Result
data.json
is included in*.nft.json
files for@sentry/[email protected]
and@sentry/[email protected]
, but not for@sentry/[email protected]
and@sentry/[email protected]
. When the app is deployed to Vercel withoutdata.json
in*.nft.json
, lambdas crash because the cannot open the file.Links
autoInstrumentServerFunctions
per default #5919The text was updated successfully, but these errors were encountered: