Skip to content

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

Description

@Whisperfall

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:

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

Environment

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:

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:

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:

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:

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions