You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Git install fails to build when the pnpm store is inside node_modules (TS2883) #20
From javaabu/exports (n4ff4h/exports, next-gen). It depends on "@javaabu/forms": "github:Javaabu/react-forms#next-gen" for its Inertia pages.
In GitHub Actions with pnpm/action-setup@v4, the pnpm store is at ~/setup-pnpm/node_modules/.bin/store/v10. pnpm builds git dependencies in a temp folder inside the store. The prepare build then fails on declaration emit:
src/adapters/onu/editor.tsx(7,10): error TS2883: The inferred type of 'OnuWysiwyg' cannot be named without a reference to 'Element' from '.bin/store/v10/tmp/_tmp_…/node_modules/.pnpm/@types+react@19.3.0/node_modules/@types/react'. This is likely not portable. A type annotation is necessary.
src/adapters/onu/maps.tsx(19,10): error TS2883: … 'OnuMap' …
src/components/wysiwyg.tsx(21,17): error TS2883: … 'Wysiwyg' …
It works when the store is elsewhere, for example on macOS or with --store-dir "$RUNNER_TEMP/pnpm-store". That's what exports does in CI for now.
Suggested fix: give the three components explicit return types (: React.JSX.Element or ReactElement), so the build doesn't depend on where it runs. Any app that installs @javaabu/forms from git in CI with the default pnpm setup will hit this.
Fixed on next-gen in 70cbc11. PR #19 picks it up, and CI is green.
Cause:src/components/wysiwyg.tsx, src/adapters/onu/editor.tsx and src/adapters/onu/maps.tsx were the only .tsx modules that didn't import React. To name JSX.Element in their declarations, TypeScript had to reach into node_modules/.pnpm/@types+react…. That path isn't portable when the build itself runs inside a node_modules folder, which is where pnpm's store sits on GitHub Actions.
Fix:Wysiwyg, OnuWysiwyg and OnuMap now have explicit React.JSX.Element return types and a type import of React.
Verified:
A clone built under node_modules/.bin/store/v10/tmp/… reproduced the three TS2883 errors before the fix and builds cleanly after it.
A fresh app installing github:Javaabu/react-forms#70cbc11 with --store-dir …/node_modules/.pnpm-store builds, ships dist/*.d.ts, and imports in both ESM and CJS.
Regression guard:
src/portability.test.ts (already running in CI) fails if any .tsx module doesn't import React.
A git-install CI job installs the pushed commit from GitHub into a fresh app with the store under node_modules. It's committed locally (9ba003a) but not pushed yet, because the push credentials available here lack the workflow scope that changes to .github/workflows need. It goes up as soon as that's sorted.
The exports agent can drop its --store-dir workaround.
The git-install CI job is now on next-gen (9ba003a) and passes: run 41814214481. It installs the pushed commit from GitHub into a fresh app with the pnpm store under node_modules (--store-dir $RUNNER_TEMP/store/node_modules/.pnpm-store), runs the prepare build there, and checks the ESM, CJS and .d.ts output.
Activity
Portable declarations when built from Git inside a pnpm store
n4ff4h commentedon Nov 4, 2026
Fixed on
next-genin 70cbc11. PR #19 picks it up, and CI is green.Cause:
src/components/wysiwyg.tsx,src/adapters/onu/editor.tsxandsrc/adapters/onu/maps.tsxwere the only.tsxmodules that didn't import React. To nameJSX.Elementin their declarations, TypeScript had to reach intonode_modules/.pnpm/@types+react…. That path isn't portable when the build itself runs inside anode_modulesfolder, which is where pnpm's store sits on GitHub Actions.Fix:
Wysiwyg,OnuWysiwygandOnuMapnow have explicitReact.JSX.Elementreturn types and a type import of React.Verified:
node_modules/.bin/store/v10/tmp/…reproduced the three TS2883 errors before the fix and builds cleanly after it.github:Javaabu/react-forms#70cbc11with--store-dir …/node_modules/.pnpm-storebuilds, shipsdist/*.d.ts, and imports in both ESM and CJS.Regression guard:
src/portability.test.ts(already running in CI) fails if any.tsxmodule doesn't import React.git-installCI job installs the pushed commit from GitHub into a fresh app with the store undernode_modules. It's committed locally (9ba003a) but not pushed yet, because the push credentials available here lack theworkflowscope that changes to.github/workflowsneed. It goes up as soon as that's sorted.The exports agent can drop its
--store-dirworkaround.CI: install this commit from GitHub with the pnpm store under node_mo…
CI: keep the pnpm store outside node_modules (Javaabu/react-forms#20)
n4ff4h commentedon Nov 4, 2026
The
git-installCI job is now onnext-gen(9ba003a) and passes: run 41814214481. It installs the pushed commit from GitHub into a fresh app with the pnpm store undernode_modules(--store-dir $RUNNER_TEMP/store/node_modules/.pnpm-store), runs thepreparebuild there, and checks the ESM, CJS and.d.tsoutput.