Closed akaltar closed 1 month ago
Please share a repro that we could run locally. It works without issues for me with "type": "module"
in package.json and node 22.
Thank you!
With "type": "module"
in the package.json
it seems to be working for me too. It just wasn't obvious from the error message that this was the problem
Version
1.47.2
Steps to reproduce
await
in the playwright.config.ts fileExpected behavior
I expect top-level await to work in the playwright config, as it's the only easy way to have the config loaded async.
Actual behavior
playwright errors out with the following error + stacktrace:
Additional context
I'm trying to load a list of skipped tests from a database to generate a
globIgnore
pattern for our flaky tests. The config file would be a great place to put it, but I have to pre-generate it in a separate invocation, because of some extra wrapping/parsing that playwright tries to do with the file, which prevents me from using anyasync
/await
patterns in the config file.I hope it would be relatively straightforward to support await when loading the config file, especially given that importing other modules seems to work fine.
I'm happy to provide a PR with a fix if someone can point me in the right direction, and if this change would be welcome.
Environment