You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
import * as rclnodejs from 'rclnodejs'; is located at the top of the file
import { useEffect } from "react"; is located at the top of the file
useEffect(() => { rclnodejs.init().then(() => { console.log("init"); }); }, []); is located inside the Index() function
npm run dev
Open web browser and navigate to localhost:3000
Open the browser's console log and refresh the page
Expected Behavior
Console Log contains the following log message:
init
Actual Behavior
Console Log contains the following error:
Uncaught ReferenceError: process is not defined
js bindings.js:23
__require2 chunk-PZDJHGND.js:18
js clock.js:17
__require2 chunk-PZDJHGND.js:18
js index.js:19
__require2 chunk-PZDJHGND.js:18
_index.tsx:23
@JackHaleGreenfield thanks for reporting this issue, the rclnodejs doesn't support web browser and it needs node.js, if you want to use web, you suggest you could leverage Electron. You can search the old issues that are relevant to Electron to see how to set it up.
Activity
minggangw commentedon Aug 11, 2023
@JackHaleGreenfield thanks for reporting this issue, the
rclnodejsdoesn't support web browser and it needs node.js, if you want to use web, you suggest you could leverage Electron. You can search the old issues that are relevant to Electron to see how to set it up.