triggerdotdev / trigger.dev

Trigger.dev is the open source background jobs platform.
https://trigger.dev/changelog
Apache License 2.0
9.1k stars 559 forks source link

Missing export tasks from `@trigger.dev/sdk/v3` #1454

Closed ericallam closed 4 hours ago

ericallam commented 5 hours ago

This is happening because of our new browser export condition that doesn't export some things that aren't compatible with browsers, but apparently this is effecting edge runtimes (I'm guessing that bundle with the "browser" custom condition but have not confirmed this.

We should export more from the browser export, especially the tasks export, but currently it's not so simple because it will pull in stuff that isn't compatible (opentelemetry).

ericallam commented 5 hours ago

A list of runtime keys: https://runtime-keys.proposal.wintercg.org/#workerd

ericallam commented 5 hours ago

Yup, looks like Cloudflare workers will bundle with the "browser" condition:

https://github.com/cloudflare/workers-sdk/blob/3ee1353d317c0e137a14f3091b32eecd575cc7a4/packages/wrangler/src/deployment-bundle/bundle.ts#L56

If we added a "workerd" or "worker" condition that exports the same as the "default" export then this would probably fix the issue for CF workers. I'm guessing we could do a similar thing for Vercel Edge functions