Skip to content

@flybot/social fails to import when installed: face-rooms.js reaches into core/src/shared via a repo-relative path #155

Closed

Description

@hsliuustc0106

Found by deploying main to a real DSH profile (plugin installed with dsh plugin --profile web add "github:…#main&path:/plugins/social"): the whole plugin fails to activate.

Observed

dsh: warning: 1 entry did not activate
flybot-social (@flybot/social): failed to import

Importing the installed package directly:

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '<profile>/node_modules/core/src/shared/face-title.js'
  imported from '<profile>/node_modules/@flybot/social/src/face-rooms.js'

Root cause

plugins/social/src/face-rooms.js:14 (face-to-face work, #107/#109/#132):

import { formatFaceRoomTitle } from '../../../core/src/shared/face-title.js'

That path only resolves inside the monorepo checkout (core/ sits beside plugins/). In an installed plugin the specifier walks out of @flybot/social into node_modules/core/…, which does not exist (the package is ds-bot, and it does not export that file). CI misses it because tests run in the repo where the path happens to resolve. This breaks the packaging invariant that a plugin ships self-contained under its files.

Scope

  • git grep '\.\./\.\./\.\./' main -- plugins/ shows exactly one shipping offender: plugins/social/src/face-rooms.js:14 (a similar import in plugins/social/test/social.test.js is test-only and never ships).
  • core/src/host/room-membership.js also uses the helper, but stays inside core, so its relative import is fine.

Suggested direction

Vendor the small, dependency-free helper into plugins/social/src/ and import it locally (plugins deliberately import nothing from ds-bot at runtime), plus a packaging regression test that scans plugins/social/src/** for import specifiers resolving outside the package — red on current main, green after the fix.

Activity

  1. hsliuustc0106 commented on Oct 17, 2026

    @hsliuustc0106
    CollaboratorAuthor

    Fixed on main by #153/#154 (the escaping import in src/face-rooms.js now loads a vendored src/face-title.js; verified on 7a7225f). Follow-up regression test so the class stays dead: #157.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions