Unexpected token error when running rosbridge with rclnodejs 0.18.0
See original GitHub issueSince the upgrade of rclnodejs from 0.17.0 to 0.18.0 running the rosbridge (ros2-web-bridge) fails with
# node /node_modules/ros2-web-bridge/bin/rosbridge.js
/external/rclnodejs/lib/context.js:47
static _instances = [];
^
SyntaxError: Unexpected token =
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/external/rclnodejs/index.js:20:17)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
The environment is pretty standard, I guess:
- docker image ros:foxy-ros-base
- ROS 2 Foxy
- Ubuntu 20.04.1 Focal
-
$ git submodule status +b082bb74a75c1773d70b2e00850468779374cd00 external/rclnodejs (0.18.0) +248f2ee44c525ebbd7c90e7c056ba62f3939eb02 external/ros2-web-bridge (0.3.0)
-
# node --version v10.23.1
We build rclnodejs and ros2-web-bridge from source in a Dockerfile
with the commands
# install Nodejs
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - && apt-get -y install nodejs
COPY external/ros2-web-bridge /external/ros2-web-bridge
COPY external/rclnodejs /external/rclnodejs
RUN /bin/bash -c ". /opt/ros/$ROS_DISTRO/setup.bash && npm i /external/rclnodejs && npm i /external/ros2-web-bridge"
Any idea what could be wrong? When checking out version 0.17.0 in submodule rclnodejs
, it works (but with the issue in #752).
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top Results From Across the Web
node.js - How to solve error "SyntaxError: Unexpected token '?'"
You are getting this error because you are using an older version of node that didn't support nullable for some packages.
Read more >Error when trying to run a ros node - ROS Answers
I have this example ros publisher I have created for debugging purpose. It builds withouth any problem but when i rosrun the ros...
Read more >How to fix Unexpected Token in JSON error (for ... - YouTube
Not a programmer? Read this! ** - If you get this error in an app you didn't make, and/or you're not a web...
Read more >Error 'unexpected token' with Typescript : r/sveltejs - Reddit
It looks like your TypeScript setup is incorrect somehow. Did you forget to run npm install ? How did you set up this...
Read more >Uncaught SyntaxError: Unexpected token '<' | WordPress.org
When I disable the plugin everything works, no errors and everything loads, ... Assuming you are using the latest version of all the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I prefer we could change the cases that use the latest features to the compatible patterns because it seems that these cases are limited.
+1 and the CI could check it too.
Have submitted #773
I have submitted a PR to add the verifications of Node.js 8.x and 10.x, the results are