Skip to content

Inability to import .ts files to workflow or step files in Nitro #261

@mikkokut

Description

@mikkokut

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions