Since a few days ago, multiple long-running flows with Code steps that use require() started failing with error:
- missing ) after argument list
Minimal repro:
// used to work, now fails
const x = require('some-lib');
export const code = async (inputs) => true;
What works now
- Use ESM imports:
import * as lib from 'some-lib';
fs(and other Node core modules) aren’t available in Code;Bufferisn’t global, so:- add npm
bufferandimport { Buffer } from 'buffer', or
- add npm
Question
Is the Code piece officially ESM-only on Cloud, and which Node built-ins/typings (if any) are supported?
Thanks!