dmtrKovalenko / dmtrKovalenko/fff

[Bug]: pi-fff 0.10.5 fails to load fff-node: No "exports" main defined

Open
#803 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
10.7k
Forks
446
Avg merge
1d 21h
Merged PRs (30d)
39

Description

### Which fff frontend?

Node SDK (@ff-labs/fff-node)

### has logs

_No response_

### Description

## `pi-fff 0.10.5` fails to load `fff-node` under Pi

After updating to `0.10.5`, FFF fails when initialized inside Pi:

```text
Error: FFF init failed: No "exports" main defined in
/home/altan/.pi/agent/npm/node_modules/@ff-labs/fff-node/package.json
```

### Environment

```text
Pi: 0.84.2
pi-fff: 0.10.5
fff-node: 0.10.5
Node: v24.18.0
Bun: 1.2.20
Linux
```

I removed and reinstalled the extension from scratch, but the error remained.

I also verified that `@ff-labs/fff-node` itself appears to be installed correctly:

* `dist/index.js` exists
* `dist/index.cjs` exists
* `package.json` contains a valid `"exports"."."` entry for both `import` and `require`

Direct imports work correctly with both Node and Bun:

```bash
cd ~/.pi/agent/npm

node -e "import('@ff-labs/fff-node').then(x => console.log('OK', Object.keys(x))).catch(console.error)"
bun -e "import('@ff-labs/fff-node').then(x => console.log('OK', Object.keys(x))).catch(console.error)"
```

Both succeed.

A variable dynamic import also works outside Pi:

```bash
node -e 'const pkg="@ff-labs/fff-node"; import(pkg).then(() => console.log("OK")).catch(console.error)'
```

In `pi-fff/src/sdk.ts`, the package is loaded like this:

```ts
const pkg = detectRuntime() === "bun" ? "@ff-labs/fff-bun" : "@ff-labs/fff-node";
const p = import(pkg) as Promise<{ FileFinder: FileFinderStatic }>;
```

As a test, I changed it to a literal import:

```ts
const p = import("@ff-labs/fff-node") as Promise<{ FileFinder: FileFinderStatic }>;
```

So far this points to the dynamic import being resolved differently when executed through Pi's extension loader, rather than an issue with the published `fff-node` package itself.

No FFF log file is generated by pi-fff in this setup.

I checked the pi-fff source: FileFinder.create() is called without logFilePath or logLevel, and no fff*.log file exists anywhere under my home directory.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with pi-fff/src/sdk.ts and compare the reported variable dynamic import with the literal import while reproducing initialization in Pi. Use the listed Node and Bun import checks to confirm the package still loads directly. Done means pi-fff 0.10.5 initializes under Pi without the "exports" error.

Written by the indexing model from the issue text.

Assessment

Tech stack
bun, node.js, typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.