You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running pnpm clean:build, the build process would fail due to race conditions between interdependent packages, while pnpm build worked correctly. This occurred because the combined clean:build task would attempt to clean and rebuild packages simultaneously, causing plugins to try building before their dependencies (like the core agents package) had completed rebuilding.
Error logs (before fix)
@livekit/agents-plugin-openai:build: error TS2307: Cannot find module '@livekit/agents' or its corresponding type declarations.
@livekit/agents-plugin-silero:build: error TS2307: Cannot find module '@livekit/agents/dist/types' or its corresponding type declarations.
Solution
Modified the scripts to run clean and build sequentially rather than as a combined task. This ensures all packages are fully cleaned before any builds start.
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
The reason will be displayed to describe this comment to others. Learn more.
this looks fine.
turbo is supposed to only run tasks in parallel that do not have any inter dependencies, so wondering why this was causing you problems in the first place
Yeah the error was. When you first run build it runs fine, but then let's say you make an edit. Add a random log statement or something. then run pnpm clean:build you get something like
@livekit/agents-plugin-livekit:clean:build: src/index.ts:4:33 - error TS7016: Could not find a declaration file for module '@livekit/agents'. '/Users/shubhrakantiganguly/development/agents-js/agents/dist/index.js' implicitly has an 'any' type.
@livekit/agents-plugin-livekit:clean:build: Try `npm i --save-dev @types/livekit__agents` if it exists or add a new declaration (.d.ts) file containing `declare module '@livekit/agents';`
@livekit/agents-plugin-livekit:clean:build:
@livekit/agents-plugin-livekit:clean:build: 4 import { InferenceRunner } from '@livekit/agents';
@livekit/agents-plugin-livekit:clean:build: ~~~~~~~~~~~~~~~~~
@livekit/agents-plugin-livekit:clean:build:
@livekit/agents-plugin-livekit:clean:build: src/index.ts:9:15 - error TS2339: Property 'resolve' does not exist on type 'ImportMeta'.
@livekit/agents-plugin-livekit:clean:build:
@livekit/agents-plugin-livekit:clean:build: 9 import.meta.resolve('./turn_detector.js'),
@livekit/agents-plugin-livekit:clean:build: ~~~~~~~
@livekit/agents-plugin-livekit:clean:build:
@livekit/agents-plugin-livekit:clean:build: src/turn_detector.ts:6:26 - error TS7016: Could not find a declaration file for module '@livekit/agents'. '/Users/shubhrakantiganguly/development/agents-js/agents/dist/index.js' implicitly has an 'any' type.
@livekit/agents-plugin-livekit:clean:build: Try `npm i --save-dev @types/livekit__agents` if it exists or add a new declaration (.d.ts) file containing `declare module '@livekit/agents';`
@livekit/agents-plugin-livekit:clean:build:
@livekit/agents-plugin-livekit:clean:build: 6 import type { ipc } from '@livekit/agents';
@livekit/agents-plugin-livekit:clean:build: ~~~~~~~~~~~~~~~~~
@livekit/agents-plugin-livekit:clean:build:
@livekit/agents-plugin-livekit:clean:build: src/turn_detector.ts:7:62 - error TS7016: Could not find a declaration file for module '@livekit/agents'. '/Users/shubhrakantiganguly/development/agents-js/agents/dist/index.js' implicitly has an 'any' type.
@livekit/agents-plugin-livekit:clean:build: Try `npm i --save-dev @types/livekit__agents` if it exists or add a new declaration (.d.ts) file containing `declare module '@livekit/agents';`
@livekit/agents-plugin-livekit:clean:build:
@livekit/agents-plugin-livekit:clean:build: 7 import { CurrentJobContext, InferenceRunner, llm, log } from '@livekit/agents';
@livekit/agents-plugin-livekit:clean:build: ~~~~~~~~~~~~~~~~~
@livekit/agents-plugin-livekit:clean:build:
@livekit/agents-plugin-livekit:clean:build: src/turn_detector.ts:8:31 - error TS2307: Cannot find module 'node:url' or its corresponding type declarations.
@livekit/agents-plugin-livekit:clean:build:
@livekit/agents-plugin-livekit:clean:build: 8 import { fileURLToPath } from 'node:url';
@livekit/agents-plugin-livekit:clean:build: ~~~~~~~~~~
@livekit/agents-plugin-livekit:clean:build:
@livekit/agents-plugin-livekit:clean:build:
@livekit/agents-plugin-livekit:clean:build: Found 5 errors in 2 files.
@livekit/agents-plugin-livekit:clean:build:
@livekit/agents-plugin-livekit:clean:build: Errors Files
@livekit/agents-plugin-livekit:clean:build: 2 src/index.ts:4
@livekit/agents-plugin-livekit:clean:build: 3 src/turn_detector.ts:6
@livekit/agents-plugin-livekit:clean:build: ELIFECYCLE Command failed with exit code 2.
@livekit/agents-plugin-livekit:clean:build: ELIFECYCLE Command failed with exit code 2.
@livekit/agents-plugin-livekit:clean:build: ERROR: command finished with error: command (/Users/shubhrakantiganguly/development/agents-js/plugins/livekit) /Users/shubhrakantiganguly/Library/pnpm/.tools/pnpm/9.7.0/bin/pnpm run clean:build exited (2)
@livekit/agents-plugin-livekit#clean:build: command (/Users/shubhrakantiganguly/development/agents-js/plugins/livekit) /Users/shubhrakantiganguly/Library/pnpm/.tools/pnpm/9.7.0/bin/pnpm run clean:build exited (2)
Tasks: 1 successful, 3 total
Cached: 0 cached, 3 total
Time: 2.796s
Failed: @livekit/agents-plugin-livekit#clean:build
ERROR run failed: command exited (2)
ELIFECYCLE Command failed with exit code 2.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When running
pnpm clean:build, the build process would fail due to race conditions between interdependent packages, whilepnpm buildworked correctly. This occurred because the combinedclean:buildtask would attempt to clean and rebuild packages simultaneously, causing plugins to try building before their dependencies (like the coreagentspackage) had completed rebuilding.Error logs (before fix)
Solution
Modified the scripts to run clean and build sequentially rather than as a combined task. This ensures all packages are fully cleaned before any builds start.