docs: fix incorrect identifiers and broken syntax in code examples#17335
Open
emmayusufu wants to merge 1 commit into
Open
docs: fix incorrect identifiers and broken syntax in code examples#17335emmayusufu wants to merge 1 commit into
emmayusufu wants to merge 1 commit into
Conversation
Several snippets across the docs name methods/hooks/types that don't exist or
won't compile/run as written:
- ai-observability and logs session-replay: posthog.getSessionId() should be
posthog.get_session_id() (posthog-js uses snake_case; getSessionId is not a
real method).
- ai-observability feedback: the hook is useThumbSurvey, not useThumbSurveys.
- Go flags snippet: missing trailing comma in the posthog.Config composite
literal (gofmt: missing ',' before newline).
- Unity install: Monobehavior should be MonoBehaviour.
- feature-flags API snippet: distinct_id string literal was missing its
closing quote.
- feature-flags JS init snippets (react/web): missing comma after the
defaults property.
- Nuxt snippet: distinctId referenced a variable declared as distinctID.
- React Native: debug: {true} should be the JSX prop debug={true}.
- Segment: missing comma after accountType.
- Svelte: Node SDK link had a doubled opening parenthesis.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reading through the docs I found a set of code snippets that name methods/hooks/types that don't exist or won't compile/run as written. Each is a small, self-contained fix:
posthog.getSessionId()should beposthog.get_session_id(). posthog-js uses snake_case;getSessionIdis not a real method, so the snippet throws at runtime.useThumbSurvey, notuseThumbSurveys(the rest of the page and the source export use the singular).posthog.Configcomposite literal was missing the trailing comma afterDefaultFeatureFlagsPollingInterval(gofmt:missing ',' before newline in composite literal).Monobehaviorshould beMonoBehaviour.distinct_idstring literal was missing its closing quote.defaultsproperty, which breaks the object literal.distinctIdreferenced a variable declared asdistinctID.debug: {true}should be the JSX propdebug={true}.accountType.12 files, all one-line fixes. Happy to split if you'd prefer smaller PRs.