When using the workflow package with Nitro, importing .ts helper files into workflow or step files is not supported. It throws error:
Error: Unknown file extension ".ts" for /code/nitro-workflow-sample/lib/helpers.ts
// workflows/test.ts
import say from "../lib/helpers";
async function createUser(email: string) {
"use step";
console.log(say());
return { id: crypto.randomUUID(), email };
}
Reproduction:
A minimal example is available here: https://github.com/mikkokut/nitro-workflow-sample.
Update:
It works when deployed to Vercel, but not when running the development server locally.