这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@adriandlam
Copy link
Member

No description provided.

@vercel
Copy link
Contributor

vercel bot commented Oct 31, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
example-nextjs-workflow-turbopack Error Error Nov 15, 2025 9:30pm
example-nextjs-workflow-webpack Error Error Nov 15, 2025 9:30pm
example-workflow Error Error Nov 15, 2025 9:30pm
workbench-hono-workflow Error Error Nov 15, 2025 9:30pm
workbench-nitro-workflow Error Error Nov 15, 2025 9:30pm
workbench-nuxt-workflow Error Error Nov 15, 2025 9:30pm
workbench-sveltekit-workflow Error Error Nov 15, 2025 9:30pm
workbench-vite-workflow Error Error Nov 15, 2025 9:30pm
workflow-docs Error Error Nov 15, 2025 9:30pm

@changeset-bot
Copy link

changeset-bot bot commented Oct 31, 2025

⚠️ No Changeset found

Latest commit: 664cc36

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.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

@vercel vercel bot left a comment

Choose a reason for hiding this comment

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

🔧 Build Fix:

The file contains unresolved git merge conflict markers (<<<<<<< HEAD, =======, >>>>>>> e28cfa93). The merge conflict must be resolved by keeping the getWorkflowDirs and unique functions that are actively used by the @workflow/nitro package.

View Details
📝 Patch Details
diff --git a/packages/sveltekit/src/builder.ts b/packages/sveltekit/src/builder.ts
index f600452..b9e8e14 100644
--- a/packages/sveltekit/src/builder.ts
+++ b/packages/sveltekit/src/builder.ts
@@ -228,7 +228,6 @@ export const OPTIONS = createSvelteKitHandler('OPTIONS');`,
     }
   }
 }
-<<<<<<< HEAD
 
 /**
  * Gets the list of directories to scan for workflow files.
@@ -250,5 +249,3 @@ export function getWorkflowDirs(options?: { dirs?: string[] }): string[] {
 function unique<T>(array: T[]): T[] {
   return Array.from(new Set(array));
 }
-=======
->>>>>>> e28cfa93 (fix: cleanup builder directories (#319))

Analysis

Git merge conflict markers in sveltekit builder

What fails: TypeScript compiler fails on packages/sveltekit/src/builder.ts due to unresolved git merge conflict markers

How to reproduce:

cd packages/sveltekit && pnpm run build

Result:

[ERROR] @workflow/sveltekit:build: src/builder.ts(231,1): error TS1185: Merge conflict marker encountered.
[ERROR] @workflow/sveltekit:build: src/builder.ts(253,1): error TS1185: Merge conflict marker encountered.
[ERROR] @workflow/sveltekit:build: src/builder.ts(254,1): error TS1185: Merge conflict marker encountered.

Root cause: The repository contained unresolved git merge conflict markers (<<<<<<< HEAD, =======, >>>>>>> ) in the file that were causing TypeScript's error TS1185 during compilation. The conflict was between HEAD (which includes the getWorkflowDirs and unique functions) and an incoming commit that attempted to remove them. However, these functions are actively used in the @workflow/nitro package, so they needed to be retained.

Fix on Vercel

stepsBundlePath: '', // unused in base
workflowsBundlePath: '', // unused in base
webhookBundlePath: '', // unused in base
dirs: ["workflows", "src/workflows", "routes", "src/routes"],
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
dirs: ["workflows", "src/workflows", "routes", "src/routes"],
dirs: config?.dirs ?? ["workflows", "src/workflows", "routes", "src/routes"],

The constructor hardcodes the dirs array, which means the dirs option passed from the Vite plugin (added in plugin.ts line 100-102) will be silently ignored.

View Details

Analysis

SvelteKitBuilder constructor ignores custom dirs from plugin configuration

What fails: The dirs option passed from the Vite plugin (plugin.ts line 100-102: new SvelteKitBuilder({ dirs: options?.dirs })) is silently ignored by the SvelteKitBuilder constructor, which hardcodes a default array instead.

How to reproduce:

// In plugin.ts, configResolved hook:
const options = { dirs: ["my-workflows", "services/workflows"] };
const builder = new SvelteKitBuilder({ dirs: options.dirs });

// Expected: builder.config.dirs === ["my-workflows", "services/workflows"]
// Actual: builder.config.dirs === ["workflows", "src/workflows", "routes", "src/routes"]

Result: Custom workflow directories specified in WorkflowPluginOptions.dirs are ignored. The builder always scans only the hardcoded default directories, making the newly added dirs configuration option non-functional.

Expected: When config?.dirs is provided, it should be used. Only when not provided should the default directories be used as a fallback.

Root cause: In builder.ts line 26, the property spread on line 25 (...config) is immediately overridden by explicit dirs assignment, since JavaScript property assignments that follow a spread operator override the spread's properties.

Fix: Use nullish coalescing to preserve custom dirs while providing defaults: dirs: config?.dirs ?? ["workflows", "src/workflows", "routes", "src/routes"]

Copy link
Contributor

@vercel vercel bot left a comment

Choose a reason for hiding this comment

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

🔧 Build Fix:

The workflowPlugin function parameter options references an undefined type WorkflowPluginOptions and is never used, causing TypeScript compilation to fail with two errors.

View Details
📝 Patch Details
diff --git a/packages/sveltekit/src/plugin.ts b/packages/sveltekit/src/plugin.ts
index 99502ab..d8139f2 100644
--- a/packages/sveltekit/src/plugin.ts
+++ b/packages/sveltekit/src/plugin.ts
@@ -4,7 +4,7 @@ import { resolveModulePath } from 'exsolve';
 import type { HotUpdateOptions, Plugin } from 'vite';
 import { SvelteKitBuilder } from './builder.js';
 
-export function workflowPlugin(options?: WorkflowPluginOptions): Plugin {
+export function workflowPlugin(_options?: unknown): Plugin {
   let builder: SvelteKitBuilder;
 
   return {

Analysis

TypeScript compilation errors in SvelteKit plugin

What fails: TypeScript compiler fails on packages/sveltekit/src/plugin.ts with two errors:

  1. 'options' is declared but its value is never read (error TS6133)
  2. Cannot find name 'WorkflowPluginOptions' (error TS2304)

How to reproduce:

cd packages/sveltekit && npx tsc

Result:

src/plugin.ts(7,32): error TS6133: 'options' is declared but its value is never read.
src/plugin.ts(7,42): error TS2304: Cannot find name 'WorkflowPluginOptions'.

Fix applied: Changed the unused options parameter to _options with type unknown to suppress the error and remove the undefined type reference.

Fix on Vercel

Copy link
Contributor

@vercel vercel bot left a comment

Choose a reason for hiding this comment

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

Additional Suggestion:

The SvelteKitBuilder constructor was hardcoding the dirs array instead of respecting custom directories passed from the plugin configuration, causing the newly added dirs option to be silently ignored.

View Details
📝 Patch Details
diff --git a/packages/sveltekit/src/builder.ts b/packages/sveltekit/src/builder.ts
index e26b568..94d4345 100644
--- a/packages/sveltekit/src/builder.ts
+++ b/packages/sveltekit/src/builder.ts
@@ -23,7 +23,7 @@ export class SvelteKitBuilder extends BaseBuilder {
 
     super({
       ...config,
-      dirs: ['workflows', 'src/workflows', 'routes', 'src/routes'],
+      dirs: config?.dirs ?? ['workflows', 'src/workflows', 'routes', 'src/routes'],
       buildTarget: 'sveltekit' as const,
       stepsBundlePath: '', // unused in base
       workflowsBundlePath: '', // unused in base
diff --git a/packages/sveltekit/src/plugin.ts b/packages/sveltekit/src/plugin.ts
index 99502ab..b9dc13d 100644
--- a/packages/sveltekit/src/plugin.ts
+++ b/packages/sveltekit/src/plugin.ts
@@ -4,6 +4,14 @@ import { resolveModulePath } from 'exsolve';
 import type { HotUpdateOptions, Plugin } from 'vite';
 import { SvelteKitBuilder } from './builder.js';
 
+export interface WorkflowPluginOptions {
+  /**
+   * Directories to scan for workflow files.
+   * If not specified, defaults to ['workflows', 'src/workflows', 'routes', 'src/routes']
+   */
+  dirs?: string[];
+}
+
 export function workflowPlugin(options?: WorkflowPluginOptions): Plugin {
   let builder: SvelteKitBuilder;
 
@@ -89,7 +97,9 @@ export function workflowPlugin(options?: WorkflowPluginOptions): Plugin {
     },
 
     configResolved() {
-      builder = new SvelteKitBuilder();
+      builder = new SvelteKitBuilder({
+        dirs: options?.dirs,
+      });
     },
 
     // TODO: Move this to @workflow/vite or something since this is vite specific

Analysis

SvelteKitBuilder Constructor Ignores Custom dirs from Plugin Configuration

What fails: The dirs option passed from the Vite plugin via WorkflowPluginOptions.dirs is silently ignored by the SvelteKitBuilder constructor, which hardcodes a default array instead of respecting custom directory configurations.

How to reproduce:

// In plugin.ts configResolved() hook:
const options: WorkflowPluginOptions = { dirs: ["my-workflows", "services/workflows"] };
const builder = new SvelteKitBuilder({ dirs: options.dirs });

// Expected: builder.config.dirs === ["my-workflows", "services/workflows"]
// Actual: builder.config.dirs === ["workflows", "src/workflows", "routes", "src/routes"]

Root cause: In builder.ts line 26, the dirs property in the super() constructor call was hardcoded to a default array immediately after spreading the config object. In JavaScript, property assignments that follow a spread operator override the spread's properties, so custom dirs values were silently discarded.

What happens vs expected:

  • Actual: Custom workflow directories specified in the plugin options are ignored
  • Expected: Custom dirs configuration should be used when provided; only when not provided should defaults be used as a fallback

Fix applied:

  • Modified builder.ts line 26 to use nullish coalescing: dirs: config?.dirs ?? ["workflows", "src/workflows", "routes", "src/routes"]
  • Added WorkflowPluginOptions interface to plugin.ts defining the optional dirs property
  • Updated plugin.ts configResolved() hook to pass options to SvelteKitBuilder: new SvelteKitBuilder({ dirs: options?.dirs })

The bug was reintroduced during a merge conflict resolution (commit 664cc36) where the conflict was resolved by removing the options passing entirely instead of properly handling the merge of both code paths.

Fix on Vercel

import { SvelteKitBuilder } from './builder.js';

export function workflowPlugin(): Plugin {
export function workflowPlugin(options?: WorkflowPluginOptions): Plugin {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
export function workflowPlugin(options?: WorkflowPluginOptions): Plugin {
export type WorkflowPluginOptions = Record<string, never>;
export function workflowPlugin(_options?: WorkflowPluginOptions): Plugin {

The WorkflowPluginOptions type is used in the function signature but is never defined or imported, causing a TypeScript compilation error.

View Details

Analysis

Undefined TypeScript type in workflowPlugin function signature

What fails: packages/sveltekit/src/plugin.ts line 7 declares parameter options?: WorkflowPluginOptions but the type WorkflowPluginOptions is not defined, causing TypeScript compilation to fail with error TS2304.

How to reproduce:

cd packages/sveltekit
pnpm run build

Result: TypeScript compiler fails with:

src/plugin.ts(7,42): error TS2304: Cannot find name 'WorkflowPluginOptions'.

Expected: TypeScript compilation succeeds without errors in plugin.ts.

Fix: Added type definition for WorkflowPluginOptions as an empty interface since the parameter is not currently used. Per Vite Plugin API documentation, plugin factories should define types for their options parameter. The type is defined as Record<string, never> to explicitly indicate no options are currently supported while maintaining type safety for future expansion.

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.

3 participants