Skip to content

Using different task implementations is not workingΒ #141

@JeremiePat

Description

@JeremiePat

πŸ‘“ What did you see?

I'm trying to use the "Using different task implementations" feature, unfortunately, while using it I got the following error message in my console : Error: No task in: myfile/path.{ts,js,tsx,jsx}

βœ… What did you expect to see?

It should work as expected

πŸ“¦ Which tool/library version are you using?

Note that I'm using Node.JS 20.3.1
I'm NOT using TypeScript so there is not transpilation happening in my stack.

πŸ”¬ How could we reproduce it?

Just follow the @cucumber/screenplay documentation, it is simply not working

πŸ“š Any additional context?

I did some investigation on that bug and the error is thrown here :

const task = await Function(`return import("${path}")`)()

The issue is due to the lack of extension in the dynamique import statement (I tried to manually add an extension, it works just fine). As per the Node.JS documentation : "A file extension must be provided when using the import keyword", see : https://nodejs.org/api/esm.html#mandatory-file-extensions

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