Repository navigation
fix(tiptap): guard the process.env read in useEditor - #1501
Closed
aleclarson wants to merge 1 commit into
Closed
aleclarson wants to merge 1 commit into
aleclarson wants to merge 1 commit into
Conversation
aleclarson
marked this pull request as ready for review
October 1, 2026 15:39
aleclarson
added a commit
to octane-xplat/octane-xplat
that referenced
this pull request
Oct 1, 2026
…iptap patch PR octanejs/octane#1501 (process.env guard) was closed upstream; the patched source should not diverge in runtime behavior. The patch now only adds a module-local process declaration for typecheck and keeps the Context merge, which is being upstreamed as octanejs/octane#1502.
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.
Summary
process.env.NODE_ENVread inuseEditorso source consumers without aprocessglobal (or Node types) can compile the package.Why
types: ["node"]fails typecheck on the bareprocessreference, and a non-Node runtime (embedded JS engines, e.g. NativeScript V8) throws at evaluation.@octanejs/tiptapinto a NativeScript app: the mobile program has no Node globals.Changes
src/useEditor.ts:const isDev = typeof process === 'undefined' || process.env?.NODE_ENV !== 'production';— absentprocessreads as development, keeping dev-time checks when the env cannot be consulted.Validation
pnpm format:files(changed files unchanged)pnpm typecheck:files(tsrx-tsc, clean)vitest run --project tiptap --project tiptap-ssr --project tiptap-pristine --project tiptap-upstream --project tiptap-differential— 25 files / 45 tests passpnpm format:check(not run — repo-wide)pnpm test(not run — repo-wide)Risk / follow-ups
useEditorconstant; parity with upstream@tiptap/react's dev-gate behavior preserved whereprocessexists.Provenance
agent-authored)Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Low Risk
Single guarded constant for dev detection; production behavior unchanged when
processis present, with dev-mode warnings possible whenprocessis absent.Overview
@octanejs/tiptapships source for downstream toolchains; this patch makesuseEditorsafe when there is no Nodeprocessglobal or Node typings.isDevno longer readsprocess.env.NODE_ENVunconditionally. It usestypeof process === 'undefined' || process.env?.NODE_ENV !== 'production', so missingprocessavoids typecheck/runtime failures (e.g. NativeScript) while still treating non-production builds as dev when env is available. SSR/Next.js dev warnings that depend onisDevbehave the same whenprocessexists. A patch changeset records the release.Reviewed by Cursor Bugbot for commit 5cbb702. Bugbot is set up for automated code reviews on this repo. Configure here.