Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Invalid string length

オープン
#737 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
javascript, node.js, playwright

調査の方向性

まず、報告されている maxDepth の範囲を使って動作を再現しながら、Step インスタンスを safeSerialize() 経由で追跡し、その後 socket.io-parser の Encoder.encodeAsString まで追跡します。CodeceptUI の I.amOnPage("https://github.com") シナリオを確認し、シリアライズによって Invalid string length が発生しなくなっている一方で、ビジュアルな完了または失敗の出力が引き続き配信されることを確認します。

索引モデルが issue の本文から書いたものです。

説明

Using a fresh installation of codeceptjs (v3.7.7) and @codeceptjs/ui (v1.3.8), when running a Hello World test (using both TypeScript and JavaScript, and both plain JS-driven scenario and Gherkin scenario), the UI keeps spinning endlessly, while giving me the following output in the terminal during the first I.amOnPage() statement (using https://github.com for this test purpose):

🌟 CodeceptUI started!
👉 Open http://localhost:3333 to see CodeceptUI in a browser


Unhandled rejection
Unhandled rejection
Application window opened, switch to it to run tests...
HTML Reporter: Starting HTML report generation...
CodeceptJS v3.7.7 #StandWithUkraine
Using test root "/path/to/tests"

Hello World --
    As a Developer
    I want to test Codecept.js with Gherkin
    So I can make sure it will work for subsequent features
Unhandled rejection
Unhandled rejection
  ✖ Login page in 22208ms

-- FAILURES:

  1) Hello World
       Login page:
     
  Invalid string length                                                                                                                                                                             
  RangeError:                                                                                                                                                                                       
      at JSON.stringify (<anonymous>)                                                                                                                                                               
      at Encoder.encodeAsString (node_modules/.pnpm/socket.io-parser@4.2.6/node_modules/socket.io-parser/build/cjs/index.js:93:25)                                                                  
                                                                                                                                                                                                    
                                                                                                                                                                                                    
  ◯ File: file:///path/to/tests/features/hello.feature
  
  ◯ Scenario Steps:
  ✖ I.amOnPage("https://github.com") at ./definitions/steps.ts:12:7
  
  
  ◯ Metadata:
  - browser: chromium
  - browserVersion: 145.0.7632.6
  - windowSize: 1280x720


  FAIL  | 0 passed, 1 failed   // 23s
Run with --verbose flag to see complete NodeJS stacktrace
***************************************
nodeInfo:  24.10.0
osInfo:  macOS 26.3
cpuInfo:  (14) arm64 Apple M4 Pro
chromeInfo:  146.0.7680.153
edgeInfo:  Not Found
firefoxInfo:  Not Found
safariInfo:  26.3
playwrightBrowsers:  "chromium: 145.0.7632.6, firefox: 146.0.1, webkit: 26.0"
If you need more detailed info, just run this: npx codeceptjs info
***************************************
HTML Report saved to: /path/to/tests/output/report.html

The actual code being executed is the following, in any case:

Feature('Hello World');

Scenario('Hello', ({ I }) => {
  I.amOnPage('https://github.com');
  I.see('GitHub');
});

I started the debugger and saw a Step instance being safeSerialize(), leading to the issue. I tried changing the maxDepth default argument value. The following lead to those results:

maxDepth result
0 No visual output (expected)
[1,9] Worked (expected)
[10,17] No visual completion output (kind of unexpected, haven't investigated)
[18,[ Above error occurs, no visual failure output

This was attempted with Node.js 20 and 24.

My best guess is we have some deep copies of certain large objects being serialized, I haven't investigated more into the issue. Happy to help reproduce and debug with whoever wants to give this a shot!

主要言語
JavaScript
スター
84
フォーク
30
PR マージ指標
30日以内にマージされた PR はありません

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

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

はじめの一歩

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

codeceptjs/ui のほかの issue

codeceptjs/ui の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

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

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