fix: 0.1.1 — pin effect exactly; a caret range on a beta crash-looped the plugin #2

Merged
enricobuehler merged 1 commits from fix-effect-pin into main 2026-08-09 08:08:39 +00:00
Owner

The plugin will not start on a host — it dies at module import and the runner retries forever:

ERROR plugin:@punktfunk/plugin-virtualhere failed: UnknownError: An error occurred in Effect.tryPromise
WARN  plugin:@punktfunk/plugin-virtualhere restarting (attempt 2)

The actual error

That message is the runner losing the error, not the error. Importing the module by hand:

TypeError: Schema3.TaggedErrorClass is not a function

sdk/src/runner.ts wraps the dynamic import in a bare Effect.tryPromise (no catch) and then logs only Cause.pretty(cause).split("\n")[0] — so the real TypeError never reaches a log line.

Cause

"effect": "^4.0.0-beta.102". A caret range spans breaking prereleases.

effect still had Schema.TaggedErrorClass at beta.102 but had removed it by beta.106, so a fresh install resolved beta.106 and the contract's Schema-backed error classes failed to construct at import time — before any of this plugin's code ran.

Measured across the three relevant betas:

effect exports TaggedErrorClass
4.0.0-beta.99
4.0.0-beta.102
4.0.0-beta.106

So the fix pins to exactly beta.102 — the version this plugin was already written against, which still has the API. That's the smallest change that makes runtime match the build; no code changes needed.

Verified by reproduction, not inspection

Clean sandbox, @punktfunk scope pointed at the registry, same command:

installed resolves effect import("@punktfunk/plugin-virtualhere")
0.1.0 (published, ^4.0.0-beta.102) beta.106 TypeError: Schema3.TaggedErrorClass is not a function
0.1.1 (this PR, 4.0.0-beta.102) beta.102 virtualhere, main is a function

The failing row reproduces the host's error off-box; the passing row is the same test against this build. Gates: frozen-lockfile install, typecheck ×3, 73 tests, biome — clean.

Scope

Same class as unom/punktfunk-plugin-rom-manager#4. A survey of every plugin repo:

  • Already safe (exact pins): epic, gog, heroic, lutris, steam, xbox — all 4.0.0-beta.99
  • Fixed: rom-manager (PR #4), virtualhere (this PR)
  • Still latent: playnite 0.3.0 carries ^4.0.0-beta.99 and has the identical bug waiting

Also worth narrowing plugin-kit's own peer range, currently ^4.0.0-beta.98.

After merge

Tag v0.1.1 to publish, then re-pin the store index — its entry currently points at 0.1.0, which does not start.

The plugin will not start on a host — it dies at module import and the runner retries forever: ``` ERROR plugin:@punktfunk/plugin-virtualhere failed: UnknownError: An error occurred in Effect.tryPromise WARN plugin:@punktfunk/plugin-virtualhere restarting (attempt 2) ``` ## The actual error That message is the runner losing the error, not the error. Importing the module by hand: ``` TypeError: Schema3.TaggedErrorClass is not a function ``` `sdk/src/runner.ts` wraps the dynamic import in a **bare** `Effect.tryPromise` (no `catch`) and then logs only `Cause.pretty(cause).split("\n")[0]` — so the real TypeError never reaches a log line. ## Cause `"effect": "^4.0.0-beta.102"`. A caret range spans breaking prereleases. effect **still had** `Schema.TaggedErrorClass` at beta.102 but had **removed it by beta.106**, so a fresh install resolved beta.106 and the contract's Schema-backed error classes failed to construct at import time — before any of this plugin's code ran. Measured across the three relevant betas: | effect | exports `TaggedErrorClass` | |---|:--:| | 4.0.0-beta.99 | ✅ | | 4.0.0-beta.102 | ✅ | | 4.0.0-beta.106 | ❌ | So the fix pins to **exactly beta.102** — the version this plugin was already written against, which still has the API. That's the smallest change that makes runtime match the build; no code changes needed. ## Verified by reproduction, not inspection Clean sandbox, `@punktfunk` scope pointed at the registry, same command: | installed | resolves effect | `import("@punktfunk/plugin-virtualhere")` | |---|---|---| | `0.1.0` (published, `^4.0.0-beta.102`) | **beta.106** | ❌ `TypeError: Schema3.TaggedErrorClass is not a function` | | `0.1.1` (this PR, `4.0.0-beta.102`) | **beta.102** | ✅ `virtualhere`, `main` is a function | The failing row reproduces the host's error off-box; the passing row is the same test against this build. Gates: frozen-lockfile install, typecheck ×3, 73 tests, biome — clean. ## Scope Same class as `unom/punktfunk-plugin-rom-manager#4`. A survey of every plugin repo: - **Already safe** (exact pins): epic, gog, heroic, lutris, steam, xbox — all `4.0.0-beta.99` - **Fixed**: rom-manager (PR #4), virtualhere (this PR) - **Still latent**: **playnite 0.3.0** carries `^4.0.0-beta.99` and has the identical bug waiting Also worth narrowing plugin-kit's own peer range, currently `^4.0.0-beta.98`. ## After merge Tag `v0.1.1` to publish, then re-pin the store index — its entry currently points at `0.1.0`, which does not start.
enricobuehler added 1 commit 2026-08-09 07:47:05 +00:00
fix(deps): 0.1.1 — pin effect exactly; a caret range on a beta crash-looped the plugin
CI / build (pull_request) Successful in 27s
CI / publish (pull_request) Skipped
58839c2d32
The plugin would not start. Every launch died at module import with

    TypeError: Schema3.TaggedErrorClass is not a function

reported by the runner as the uninformative `UnknownError: An error occurred in Effect.tryPromise`
(`sdk/src/runner.ts` wraps the import in a bare `tryPromise` and logs only the first line of the
cause, so the real TypeError never reaches a log line).

Cause: `"effect": "^4.0.0-beta.102"`. A caret range spans breaking prereleases. effect still had
`Schema.TaggedErrorClass` at beta.102 but had removed it by beta.106, so a fresh install resolved
beta.106 and the contract's Schema-backed error classes failed to construct at import time — before
any of this plugin's code ran.

Pinned to exactly the version it was already written against, beta.102, which still has the API;
this is the smallest change that makes runtime match the build. Measured: beta.99 and beta.102 both
export TaggedErrorClass, beta.106 does not.

Verified by reproduction rather than inspection — clean sandbox, same command:
  0.1.0 (^4.0.0-beta.102) -> resolves effect beta.106 -> import fails with the TypeError above
  0.1.1 (4.0.0-beta.102)  -> resolves effect beta.102 -> import OK, default export `virtualhere`

Gates: frozen-lockfile install, typecheck x3, 73 tests, biome — all clean.

Same class of bug as punktfunk-plugin-rom-manager#4. The other plugins (epic, gog, heroic, lutris,
steam, xbox) already pin exactly and are unaffected; playnite still carries `^4.0.0-beta.99` and
has the same latent bug.
enricobuehler merged commit 22e764bea3 into main 2026-08-09 08:08:39 +00:00
enricobuehler deleted branch fix-effect-pin 2026-08-09 08:08:43 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: unom/punktfunk-plugin-virtualhere#2