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

feat: Ability to change the node version

Open gorbak25 opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe.

In a data processing pipeline which uses a lot of grouping operations introduced in node v21 the code fails with.

TypeError: Map.groupBy(...).entries(...).map is not a function

From what I see trigger runs on node v20.

Describe the solution you'd like to see

Allow users to change the node version in their trigger config. I understand that this will increase the testing and maintenance cost a LOT so it's probably not worth implementing.

Describe alternate solutions

  1. Document how to conditionally polifill unavailable features
  2. Warn if one uses too new features unavailable in the runtime

Additional information

No response

gorbak25 avatar Nov 12 '24 10:11 gorbak25

For now I've added poly-fills directly to trigger.config.ts

// Add polifills for Node v22
// https://github.com/triggerdotdev/trigger.dev/issues/1468
import 'core-js/actual/iterator';
import 'core-js/actual/object';
import 'core-js/actual/map';

gorbak25 avatar Nov 12 '24 12:11 gorbak25

Thanks, this is useful especially with the polyfills!

We're going to be adding a new runtime option for Node 22 quite soon.

matt-aitken avatar Nov 12 '24 13:11 matt-aitken