-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rclnodejs cannot be used with React #926
Labels
Comments
@JackHaleGreenfield thanks for reporting this issue, the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
rclnodejs generates a ReferenceError in the console log of ReactJS apps trying to use it. This error occurs simply by trying to call the init() function of the rclnodejs package (as per the typescript example in this project's README). Although the error message says is referencing the "process" package, manually installing "process" via npm does not resolve this error. The same behavior is seen with both Foxy and Humble versions of ROS2.
Steps To Reproduce
npx create-remix
source /opt/ros/foxy/setup.bash
cd my-remix-app && npm install rclnodejs
app/routes/_index.tsx
so thatimport * as rclnodejs from 'rclnodejs';
is located at the top of the fileimport { useEffect } from "react";
is located at the top of the fileuseEffect(() => { rclnodejs.init().then(() => { console.log("init"); }); }, []);
is located inside theIndex()
functionnpm run dev
localhost:3000
Expected Behavior
Console Log contains the following log message:
Actual Behavior
Console Log contains the following error:
The text was updated successfully, but these errors were encountered: