Skip to content

Commit 42e8a17

Browse files
Teo Koon PengMinggang Wang
authored andcommitted
add a note explaining a possible error that can happen when using jest
1 parent 5977094 commit 42e8a17

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,30 @@ To visit the on-line version, please navigate to http://robotwebtools.org/rclnod
139139

140140
* [actionlib](https://github.com/RobotWebTools/rclnodejs/blob/develop/tutorials/actionlib.md) - as the [rcl](https://github.com/ros2/rcl) library has implemented the action related functions, we are going to drop this one and we don't garantee the current actionlib can work with [rclcpp](https://github.com/ros2/rclcpp).
141141

142+
## Troubleshooting
143+
144+
### Maximum call stack size exceeded error when running in Jest
145+
When running tests in Jest, you may see an error like this:
146+
```
147+
RangeError: Maximum call stack size exceeded
148+
149+
at debug (../node_modules/ref/node_modules/debug/src/debug.js:1:1)
150+
at Object.writePointer [as _writePointer] (../node_modules/ref/lib/ref.js:746:3)
151+
at Object.writePointer [as _writePointer] (../node_modules/ref/lib/ref.js:747:11)
152+
at Object.writePointer [as _writePointer] (../node_modules/ref/lib/ref.js:747:11)
153+
at Object.writePointer [as _writePointer] (../node_modules/ref/lib/ref.js:747:11)
154+
at Object.writePointer [as _writePointer] (../node_modules/ref/lib/ref.js:747:11)
155+
at Object.writePointer [as _writePointer] (../node_modules/ref/lib/ref.js:747:11)
156+
at Object.writePointer [as _writePointer] (../node_modules/ref/lib/ref.js:747:11)
157+
at Object.writePointer [as _writePointer] (../node_modules/ref/lib/ref.js:747:11)
158+
at Object.writePointer [as _writePointer] (../node_modules/ref/lib/ref.js:747:11)
159+
```
160+
This is caused by a bug in `ref` which happens when you `require` it multiple times. There is a fix available for `ref` but it's no longer being maintained and the author has not published it.
161+
162+
163+
If it is required to use Jest, a solution would be to fork `ref` and use npm shrinkwrap to installed a patched version.
164+
165+
142166
## Get Involved
143167

144168
### Contributing

0 commit comments

Comments
 (0)