trigger.dev icon indicating copy to clipboard operation
trigger.dev copied to clipboard

bug: Pure type file in trigger folder breaks deployment

Open paduc opened this issue 9 months ago • 0 comments

Provide environment information

System: OS: macOS 15.3 CPU: (12) arm64 Apple M4 Pro Memory: 267.28 MB / 24.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 22.12.0 - ~/.nvm/versions/node/v22.12.0/bin/node Yarn: 1.22.22 - ~/.nvm/versions/node/v22.12.0/bin/yarn npm: 11.0.0 - ~/.nvm/versions/node/v22.12.0/bin/npm

Describe the bug

Deploy fails when there is a file that exports only a type in a trigger directory.

TypeError: Cannot convert undefined or null to object
             at Function.keys (<anonymous>)
             at getExportNames (file:///.npm/_npx/b408398ddf001950/node_modules/trigger.dev/src/indexing/registerTasks.ts:76:19)
             at registerTasks (file:///.npm/_npx/b408398ddf001950/node_modules/trigger.dev/src/indexing/registerTasks.ts:28:30)
             at bootstrap (file:///.npm/_npx/b408398ddf001950/node_modules/trigger.dev/src/entryPoints/deploy-index-worker.ts:89:24)
             at file:///.npm/_npx/b408398ddf001950/node_modules/trigger.dev/src/entryPoints/deploy-index-worker.ts:99:49

Reproduction repo

.

To reproduce

Use the default trigger.config.ts file with:

export default defineConfig({
  ...
  dirs: ['./trigger'],
  ...
})

Add a trigger/HelloWorld.ts file with the following contents :

export type HelloWorld = {
    message: string
}

Deploy npx [email protected] deploy

Additional information

No response

paduc avatar Mar 26 '25 13:03 paduc