Migrate CodeceptJS to ESM (Top-level await)

オープン
#4,185 コメント 8 件 リアクション 1 件 担当者 2 名 GitHub で見る

@DenysKuchma がすでに取り組んでいます。

2026年1月8日 から。

評価

この issue はまだ評価されていません。

説明

4.0
What are you trying to achieve?

I need to use top-level await to retrieve config from AWS and other APIs but CodeceptJS seems completely incompatible with ES modules. Top-level await is simply not possible in CommonJS. Are there any plans to support ES modules?

What do you get instead?

If you set "type": "module" in package.json you get this error:

Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/REDACTED/config/codecept.conf.js from /Users/REDACTED/node_modules/codeceptjs/lib/config.js not supported.
Instead change the require of codecept.conf.js in /Users/REDACTED/node_modules/codeceptjs/lib/config.js to a dynamic import() which is available in all CommonJS modules.
    at loadConfigFile (/Users/REDACTED/node_modules/codeceptjs/lib/config.js:160:26)
    at Config.load (/Users/REDACTED/node_modules/codeceptjs/lib/config.js:91:14)
    at module.exports.getConfig (/Users/REDACTED/node_modules/codeceptjs/lib/command/utils.js:14:33)
    at module.exports (/Users/REDACTED/node_modules/codeceptjs/lib/command/run.js:18:16)
    at Command.<anonymous> (/Users/REDACTED/node_modules/codeceptjs/bin/codecept.js:9:11)
Details
  • CodeceptJS version: 3.5.13-beta.3
  • NodeJS Version: v20.10.0
  • Operating System: MacOS Ventura
主要言語
JavaScript
スター
4.2k
フォーク
756
平均マージ
2日 9時間
マージ済み PR(30日)
16

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

codeceptjs/CodeceptJS のほかの issue

codeceptjs/CodeceptJS の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。