Skip to content

With esm: AVA 2 supports type: module, AVA 3 doesn't #2432

Closed
@fregante

Description

@fregante

I know that full ESM support is WIP (#2293) but I wanted to document this regression.

Error: ECMAScript Modules are not supported in this Node.js version.

This exact combination fails:

  • Node 12.15 (12.16+ fails regardless)
  • AVA 3.0+ (2.4- works)
  • ava.require: esm
  • type: module in the current package.json

I also tried dropping the internal supportsESM function but it fails regardless.

A live demo can be seen on vadimdemedes/dom-chef#56 (commits)

demo


I also tried ava --experimental-modules (changing the require().default to import and dropping esm) but for some reason it says it's still a require. I probably don't want to get into that since a dependency isn't type: module either

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions