-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[sentry/cloudflare] Sentry import breaks Env type #16099
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
I cannot reproduce this in the exact way you're describing. I am getting a type error on |
I'm also experiencing this behavior. It exists when using the newest wrangler setup. In newer setups the root typescript does not include Then my
I don't even have So when I add If I use the new wrangler features for ![]() But if I remove the import to sentry, this no longer occurs. My wrangler version is My app is based on this template: https://github.com/cloudflare/templates/blob/staging/react-router-postgres-ssr-template So that's likely a good spot to test an integration. |
It's also possible that this is some artifact of |
I think it's possible that it is a I have I tried a bunch of ways to try to make this go away. I was hopeful that just a line like this in my {
"paths": {
"@cloudflare/workers-types": "./empty.d.ts"
}
} I also tried the Eventually I got a hacky solution, that works for now. Maybe it's helpful to someone else until this is resolved. I found a unique version of Then I ran Then I hopped into the folder that it generates for you and patched both
Once both those files were replaced with that line, I ran the patch-commit command to create the patch:
Then I ran Definitely a short term fix, but hopefully it unblocks someone! |
@SlexAxton your setup exactly matches mine. Monorepo, pnpm, recent wrangler upgrade |
I'm curious what happens if you report this to pnpm, perhaps they'll consider it a bug on their side? |
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/cloudflare
SDK Version
9.13.0
Framework Version
React Router 7.5.1, Vite 6.3.0, Wrangler 4.12.0
Link to Sentry event
No response
Reproduction Example/SDK Setup
Steps to Reproduce
@sentry/cloudflare
v9.13.0workers/app.ts
import * as Sentry from "@sentry/cloudflare"; // <-- this line breaks the Env types
// import * as Sentry from "@sentry/cloudflare";
Expected Result
Types should not be corrupted by import Sentry
Actual Result
Broken:
Working (when import is commented out):
The text was updated successfully, but these errors were encountered: