Skip to content

Can't save or run tests on webpack compiled scripts #1092

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

Open
ckbedwell opened this issue Mar 20, 2025 · 2 comments
Open

Can't save or run tests on webpack compiled scripts #1092

ckbedwell opened this issue Mar 20, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@ckbedwell
Copy link
Contributor

ckbedwell commented Mar 20, 2025

Problem

If using webpack-compiled scripts that obfuscate the code, we make assumptions on the frontend that it is invalid script when in fact it isn't.

This problem applies to:

  1. Script does not export any options
  2. Script must set the type to chromium in the browser options.
  3. Script must import { browser } from 'k6/browser'

The scripted input with a valid webpack compiled script showing an error saying 'Script does not export any options'.

Acceptance criteria

There isn't a clear solution for this problem. The acceptance criteria will be allowing perfectly valid compiled scripts to run and be saved. Potential solutions include:

  • Make this validation to be optional or dismissable
  • more intelligent detection on the FE that the script is valid (I think this is a giant can of worms...)
  • have a sandboxed api that can be called upon to validate scripts
@ckbedwell ckbedwell added the bug Something isn't working label Mar 20, 2025
@peterschretlen
Copy link
Contributor

Typically weback will be used with terraform, but still a problem in the UI because the test button cannot be used when the validation we have in place fails.

@peterschretlen
Copy link
Contributor

Related issue: #864
With backend we can do deeper inspection/validation of the script, which will eventually be needed for supporting things like archives (which would be an alternative to using webpack in this case)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants