Visitar URL original
bug: RBAC loader logs "plugin found but failed to load" when @triggerdotdev/plugins is simply not installed · Issue #5083 · triggerdotdev/trigger.dev · GitHub
Skip to content

bug: RBAC loader logs "plugin found but failed to load" when @triggerdotdev/plugins is simply not installed #5083

Open

Description

@kevinj-blee

Provide environment information

Self-hosted, official Helm chart 4.8.1 (image ghcr.io/triggerdotdev/trigger.dev:v4.8.1) on Kubernetes 1.35. The plugins package is not installed, which is the normal state for a self-hosted install. REQUIRE_PLUGINS and RBAC_LOG_FALLBACK are not set.

Describe the bug

On every webapp boot a self-hosted instance logs this at error level:

RBAC: plugin found but failed to load; falling back to default implementation Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@triggerdotdev/plugins' imported from /triggerdotdev/apps/webapp/build/server/assets/server-build-<hash>.js

The plugin was not found, it is simply not installed. Per the comments in the loader, that case should be silent unless RBAC_LOG_FALLBACK=1, and the "found but failed to load" error is meant only for a plugin that is present but broken.

The cause is the check that tells the two cases apart (rbac/src/index.ts#L167-L209):

const moduleName = "@triggerdotdev/plugins/rbac";
// ...
const isPluginItselfMissing = isModuleNotFound && message.includes(moduleName);

When the whole package is absent, Node's error names only the package, not the subpath: Cannot find package '@triggerdotdev/plugins'. So message.includes("@triggerdotdev/plugins/rbac") is false, and the missing plugin is classified as a broken one.

The SSO and billing loaders use the same check (sso/src/index.ts#L60-L93, billing/src/index.ts#L78). We only saw the RBAC line, presumably because those load lazily. The code is unchanged on main.

Expected: no error log when @triggerdotdev/plugins is not installed.

Reproduction repo

N/A: reproduces with the official chart/image; code links above.

To reproduce

  1. Install or upgrade the official Helm chart 4.8.1 (any self-hosted install without @triggerdotdev/plugins).
  2. kubectl -n <ns> logs deploy/<release>-webapp -c webapp | grep RBAC
  3. See the "plugin found but failed to load" error on each boot.

Suggested fix

Also accept the quoted package name when deciding whether the plugin itself is missing, e.g.

const isPluginItselfMissing =
  isModuleNotFound &&
  (message.includes(moduleName) || message.includes("'@triggerdotdev/plugins'"));

and the same in the SSO and billing loaders. Matching the quoted name, not the bare one, keeps a broken plugin loud: if an installed plugin's own dependency is missing, the message quotes that dependency's name, and @triggerdotdev/plugins appears only unquoted in the imported from path.

Additional information

Harmless at runtime (the fallback is the documented self-hosted behaviour), but an error-level line on every boot sends self-hosters looking for a broken install.

Activity

  1. itsfaryal commented on Oct 28, 2026

    @itsfaryal

    hi, I'd like to work on this. I've reproduced the issue and prepared the fix for the rbac, sso, and billing loaders, including mock-free integration tests per CONTRIBUTING.md.
    Before opening a Draft PR, could you confirm this is available and clarify the new contributor vouching process?

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