The inferred type of "X" cannot be named without a reference to "Y". This is likely not portable. A type annotation is necessary.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.3k
- Forks
- 217
- Avg merge
- 8h 42m
- Merged PRs (30d)
- 1
Description
This error we have while trying installing dependencies with ts build (dependency is another repo with prepare script) by this action.
The inferred type of "X" cannot be named without a reference to "Y". This is likely not portable. A type annotation is necessary.
Locally or on self-hosted runner all be fine. I try add node-linker=hoisted or auto-install-peers = true and error still exists.
But on our runner pnpm has another store directory (pnpm installed by npm install -g pnpm@7)
// self-host runner
/home/{user}/.local/share/pnpm/store/v3`
// cloud runner with this action
/home/runner/setup-pnpm/node_modules/.bin/store/v3
And after changing store directory to same as self-host runner, the error is gone
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 7
- name: Create store dir
run: mkdir -p ~/.local/share/pnpm/store/v3
- name: Reassign store dir
run: pnpm config set store-dir ~/.local/share/pnpm/store/v3
I don't know where this error, mb because path of runner contain node_modules or something else. Hope this helps someone else
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the action's pnpm installation and store-directory configuration, then reproduce the dependency prepare/build on a GitHub-hosted runner versus a self-hosted runner. Done means identifying why the different store path triggers the TypeScript portability error and documenting or implementing a reliable configuration that avoids it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, nodejs, typescript
- Domain
- ci-cd, devops, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100