Skip to content

Conversation

s1gr1d
Copy link
Member

@s1gr1d s1gr1d commented Sep 11, 2025

Since Nitro v2.11.7, the platform-specific properties like cloudlfare and cf are nested under _platform (nitrojs/nitro#3224).

The isEventType function is updated to reflect this change.

fixes: #17588

cursor[bot]

This comment was marked as outdated.

Copy link
Member

@mydea mydea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch!

@s1gr1d s1gr1d enabled auto-merge (squash) September 11, 2025 10:14
} else if (event?.context && hasCfProperty(event.context)) {
// legacy support (before Nitro v2.11.7 (PR: https://github.com/nitrojs/nitro/pull/3224))
storedTraceData = traceDataMap.get(event.context.cf);
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Cloudflare Plugin Trace Data Inconsistency

The Cloudflare plugin's trace data storage and retrieval use different priority orders for identifying the cf object as a WeakMap key. This inconsistency can cause trace data lookups to fail, resulting in missing Sentry tracing meta-tags in the HTML. Also, accessing _platform on an H3Event type may lead to TypeScript compilation errors.

Fix in Cursor Fix in Web

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is no problem when the same nitro version is used (which is the case on the same server)

@s1gr1d s1gr1d merged commit fefb37d into develop Sep 11, 2025
38 checks passed
@s1gr1d s1gr1d deleted the sig/nitro-cloudflare-workers branch September 11, 2025 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inaccurate Error reporting in Cloudflare Workers
2 participants