Closed meyerj closed 3 years ago
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - && apt-get -y install nodejs
Upgrading to Node.js 12.x (v12.20.1) solves the issue. In that case the Prerequisites section in the README.md may need an update?
I deem the description of the required Node.js is outdated, it was tested a long time ago, so it needs to be corrected.
I look through the current codebase and found we used some ES2019 features that node < v10.x doesn't support, so I think that caused the problem you met.
Usage of static class fields
that gets supported since Node.js 12.4.0
https://github.com/RobotWebTools/rclnodejs/blob/31efa7c28e8d20bcd6fe1311fb10e9afa7bd63a7/lib/context.js#L47
Usage of Array.prototype.flat
that gets supported since Node.js 11.15.0
https://github.com/RobotWebTools/rclnodejs/blob/31efa7c28e8d20bcd6fe1311fb10e9afa7bd63a7/rosidl_gen/packages.js#L138-L140
Also, you can check it on https://node.green to see the detailed status. So I think it's the time to update the README accordingly, thanks for your feedback!
will support for anything less than 12 be dropped or the code will change to keep compatibility?
@minggang I recognize that some of my contribs helped create this node compatibility problem. Propose the following:
I have submitted a PR to add the verifications of Node.js 8.x and 10.x, the results are
1. we consider including a polyfill library such as [core-js](https://www.npmjs.com/package/core-js) to enable a more modern coding experience without introducing compat issue such as those you highlighted.
I prefer we could change the cases that use the latest features to the compatible patterns because it seems that these cases are limited.
2. update the contribution guidelines to explicitly call out the js spec level requirements for devs to adhere to.
+1 and the CI could check it too.
3. add compatibility validation to our test/CI.
Have submitted #773
Since the upgrade of rclnodejs from 0.17.0 to 0.18.0 running the rosbridge (ros2-web-bridge) fails with
The environment is pretty standard, I guess:
We build rclnodejs and ros2-web-bridge from source in a
Dockerfile
with the commandsAny idea what could be wrong? When checking out version 0.17.0 in submodule
rclnodejs
, it works (but with the issue in #752).