fix(@nylas/react): correct Connect import paths in README - #94
Merged
Conversation
`useNylasConnect` and `NylasConnectButton` are exported only from the `@nylas/react/connect` subpath. `src/index.ts` re-exports `./elements` and `./utils`, neither of which reaches them, so the four README snippets importing from `@nylas/react` could not resolve. Also corrects the Exports overview, which claimed the Connect symbols were importable from `@nylas/react` as well as `@nylas/react/connect`. The Elements entries are unaffected: `NylasSchedulerEditor` and `NylasScheduling` genuinely resolve from the package root. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
AaronDDM
approved these changes
Sep 1, 2026
AaronDDM
left a comment
Collaborator
There was a problem hiding this comment.
Good afternoon!
Checked this against the source and the fix is correct. packages/react/src/index.ts only re-exports ./elements and ./utils, so neither useNylasConnect nor NylasConnectButton is reachable from the package root. ./connect is a real entry in the exports map, so the new paths resolve.
All four snippets plus the exports overview line are covered, and you correctly left the Elements imports alone — those do resolve from the root. Changeset is there.
Approving.
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.
Problem
Four README snippets tell users to import the Connect symbols from the package root:
Neither symbol is exported from there, so every one of those snippets fails. Under ESM — the normal case for a React app — it is a hard link-time error before any code runs:
Via CJS
requireit instead yieldsundefined, then aTypeErrorat call time.This is a docs-only bug. The library itself is fine — the exports map and build are correct, and
@nylas/react/connecthas always worked. Only readers copying these snippets are affected.Why they don't resolve
packages/react/src/index.tsis only:Neither barrel reaches the Connect symbols. They are defined and exported solely under
src/connect/:connect/useNylasConnect.ts:50,connect/NylasConnectButton.tsx:66connect/index.ts:5,8That is reachable only through the
./connectsubpath, which is a real build entry —vite.config.ts:14buildsconnectfromsrc/connect.tsand emitsdist/es/connect.js, matching the./connectcondition inpackage.json.Fix
@nylas/react/connect.@nylas/reactor@nylas/react/connect". The first half is wrong; it now names only the subpath.The Elements entries are deliberately untouched —
NylasSchedulerEditorandNylasSchedulingreally do resolve from the package root, so line 30 and the import at line 46 are correct as written.No source changes. Patch changeset included so the corrected README reaches npmjs.com, where the broken snippets are currently published.
🤖 Generated with Claude Code