Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 28, 2025

The FileLoaderTask class name collision between browser and server implementations caused ambiguous export errors during testing when both environments were loaded through conditional package exports.

Changes

  • Updated test imports: Modified both test files to import directly from source files instead of package exports:
    • FileLoaderTask.test.ts: imports from @workglow/tasks/src/task/FileLoaderTask
    • FileLoaderTask.server.test.ts: imports from @workglow/tasks/src/task/FileLoaderTask.server

Context

The server implementation extends the base class and overrides it in the TaskRegistry (both share static type = "FileLoaderTask"). This allows environment-specific implementations without code changes.

// Browser: exports FileLoaderTask
export * from "./task/FileLoaderTask";

// Node/Bun: exports FileLoaderTask (server version)
export * from "./task/FileLoaderTask.server";

During testing, when both test files were loaded, the conditional package exports caused ambiguous exports. By importing directly from source files, the tests explicitly choose which implementation to use, bypassing the export resolution issue while maintaining the original class names.

The server implementation delegates HTTP/HTTPS URLs to the parent class while handling file:// URLs with Node.js filesystem APIs.

Original prompt

Reference: https://github.com/workglow-dev/workglow/actions/runs/20560427345/job/59050297222#step:7:1

Fix the error


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copy link
Collaborator

@sroussey sroussey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t want it renamed

Copilot AI changed the title [WIP] Fix error in Workglow job execution Fix FileLoaderTask export ambiguity in server environments Dec 28, 2025
Copilot AI requested a review from sroussey December 28, 2025 23:53
Copy link
Contributor Author

Copilot AI commented Dec 28, 2025

I don’t want it renamed

I've reverted the class renaming. The fix now imports directly from source files in the tests (@workglow/tasks/src/task/FileLoaderTask for browser tests and @workglow/tasks/src/task/FileLoaderTask.server for server tests) instead of using the package exports. This resolves the ambiguous export error while keeping the original class names. Changes in commit 8298066.

Copilot AI changed the title Fix FileLoaderTask export ambiguity in server environments Fix FileLoaderTask export ambiguity by importing from source in tests Dec 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants