Commit d6a4c02
committed
fix(workers): Use dynamic imports to work around Node 22.x ES Module loader bug
- Delay importing of event, container, Codecept, and utility modules
- Use dynamic imports inside async init function instead of top-level imports
- Prevents 'Cannot read properties of undefined (reading getStatus)' error
This is a workaround for a known Node.js 22.x bug where worker threads
fail to load ES modules that have complex dependency chains. The error
occurs in the internal module loader when trying to load ESM from CJS.
Note: This partially mitigates the issue but the fundamental bug in
Node 22.x's module loader may still cause intermittent failures. The
issue has been reported to the Node.js project.1 parent 112ce88 commit d6a4c02
1 file changed
+24
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | 20 | | |
24 | 21 | | |
25 | 22 | | |
| |||
76 | 73 | | |
77 | 74 | | |
78 | 75 | | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | 76 | | |
85 | 77 | | |
86 | 78 | | |
87 | 79 | | |
| 80 | + | |
88 | 81 | | |
89 | 82 | | |
90 | 83 | | |
91 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
92 | 104 | | |
93 | 105 | | |
94 | 106 | | |
| |||
0 commit comments