Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
knassar702 opened this issue Apr 14, 2022 · 0 comments · May be fixed by #1296
Open

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

knassar702 opened this issue Apr 14, 2022 · 0 comments · May be fixed by #1296

Comments

@knassar702
Copy link

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

> zap-hud@1.0.0 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

@njmulsqb njmulsqb linked a pull request Sep 20, 2023 that will close this issue
@thc202 thc202 changed the title Building Error Running ava fails with SyntaxError: Cannot use import statement outside a module Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant