Skip to content

Running ava fails with SyntaxError: Cannot use import statement outside a module #1103

Open
@MindPatch

Description

@MindPatch

Hello, I tried to build your JS code using the npm command that I found on your Wiki page, but I got a small error because of the import ava module and the utils.js file

> [email protected] test
> ava


  Uncaught exception in src/test/js/utils.test.js

  SyntaxError: Cannot use import statement outside a module

  ✖ src/test/js/utils.test.js exited with a non-zero exit code: 1
  ─

  One uncaught exception

FAILURE: Build failed with an exception.

you should change the import command from import test from ava to const test = require('ava')

best regards
Khaled

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