Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/bundle-skills-env.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"trigger.dev": patch
---

Pass `TRIGGER_API_URL` and `TRIGGER_SECRET_KEY` to the `bundleSkills` indexer pass in dev so it matches the env the main worker indexer gets. Without this, task files that read CLI-injected env vars at module top level threw on import in the skill-discovery pass while succeeding in the real worker, surfacing as a spurious `[bundleSkills] skill discovery failed, skipping skill bundling: Failed to import some task files` warning on every dev rebuild for any project that doesn't duplicate `TRIGGER_API_URL` into its `.env`.
10 changes: 9 additions & 1 deletion packages/cli-v3/src/dev/devSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ export async function startDevSession({

// Built-in skill bundling — copies registered skill folders into
// `.trigger/skills/{id}/` so `skill.local()` works at dev runtime.
// The indexer pass must match the main worker indexer's env (see
// devSupervisor.#getEnvVars) — otherwise task files that read
// CLI-injected vars (TRIGGER_API_URL, TRIGGER_SECRET_KEY) at module
// top level throw on import here while succeeding in the real worker.
try {
const buildManifestPath = join(
workerDir?.path ?? destination.path,
Expand All @@ -131,7 +135,11 @@ export async function startDevSession({
buildManifest,
buildManifestPath,
workingDir: rawConfig.workingDir,
env: process.env,
env: {
...process.env,
TRIGGER_API_URL: client.apiURL,
TRIGGER_SECRET_KEY: client.accessToken ?? undefined,
},
logger: buildContext.logger,
});
buildManifest = skillsResult.buildManifest;
Expand Down
Loading