Skip to content

Syntax error when running with vitest #23

@aenand

Description

@aenand

Hello! I am trying to use this action to track tests for my Javascript app that uses vitest. When following the vitest section of the guide, the command to run the test errors out. Any idea what causes this?

Step:

    - run: npm run build --if-present
    - name: Configure Datadog Test Visibility
      uses: datadog/test-visibility-github-action@v2
      with:
        languages: js
        service: {{ service_name }}
        api_key: ${{ secrets.DD_API_KEY }}
        site: datadoghq.com # Change if your site is not US1
    - name: Run tests
      run: npm run test
      env: 
        NODE_OPTIONS: -r ${{ env.DD_TRACE_PACKAGE }} --import ${{ env.DD_TRACE_ESM_IMPORT }}

Error:

failed to load config from {{path_to_file}}/vitest.config.ts

⎯⎯⎯⎯⎯⎯ Unhandled Error ⎯⎯⎯⎯⎯⎯⎯
SyntaxError: Identifier '$haml' has already been declared
    at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:168:18)
    at callTranslator (node:internal/modules/esm/loader:279:14)
    at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:285:30)

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions