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

Artillery fails to execute tests when 'type: module' is set in package.json despite ESM support #3491

Open
davidjjohn97 opened this issue Feb 28, 2025 · 0 comments

Comments

@davidjjohn97
Copy link

Issue:
Identified a compatibility issue in Artillery where it fails to properly handle ESM modules when "type": "module" is specified in package.json, despite claiming ESM support. The error manifests as "module is not defined" during test compilation, forcing users to maintain separate package configurations for Artillery tests. This impacts projects trying to standardize on ESM modules and requires additional configuration management to work around.

Version info: <2.0.22>

<version>

Running this command:

artillery run load-test.ts

I expected to see:
Artillery to properly handle ESM modules when "type": "module" is specified in package.json, since Artillery documentation claims ESM support.

Instead, this happened:
Received ReferenceError: module is not defined at dist/gismo-load-test.ts:26:1, indicating Artillery's compiler is not properly handling ESM module syntax when "type": "module" is set in package.json.

Current workaround: Created a separate package.json without "type": "module" specifically for Artillery tests.

Stack trace shows the error occurs during module compilation:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant