Hello,
I am following the steps from the LucidChart Developer Docs “Using web frameworks | Using React: found here.
I created an empty directory: C:\ReactLucidTest
Following step 1, i created a package called “reacttest”
I also created an editor extension called “with-cool-ui’.
In step 2, I created the react app called rightpanel inside of with-cool-ui extension. npm start successfully launched my browser and showed the CRA application.
In step 3, I opened up "C:\ReactLucidTest\reacttest\editorextensions\with-cool-ui\webpack.config.js" in notepad and replaced it with the code from the Developer Docs in step 3.
In step 4, I opened up "C:\ReactLucidTest\reacttest\editorextensions\with-cool-ui\src\extension.ts" and replaced the contents with the code found in step 4 on Developer Docs in step 4.
In step 5, I am getting an error when running the command “npx lucid-package test-editor-extension with-cool-ui”. The server from step 2 is still running.
Here is the exact error:
“
Executing onWatchRun build scripts
stderr error mkdir -p ../../public/rightpanel &&curl http://localhost:3000 | sed -E "s/(src|href)=\"/\\1=\"http:\/\/localhost:3000/gi" > ../../public/rightpanel/index.html: The syntax of the command is incorrect.
Listening at http://localhost:9900/extension.js
Listening at http://localhost:9901/shapeLibraries
Found npm start script in C:\ReactLucidTest\reacttest\editorextensions\with-cool-ui\rightpanel.
node:events:491
throw er; // Unhandled 'error' event
^
Error: spawn npm ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:283:19)
at onErrorNT (node:internal/child_process:476:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
at ChildProcess._handle.onexit (node:internal/child_process:289:12)
at onErrorNT (node:internal/child_process:476:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -4058,
code: 'ENOENT',
syscall: 'spawn npm',
path: 'npm',
spawnargs: [ 'start' ]”
Anyone able to help? Maybe in step 3 or 4, the code on the Developer Docs that I pasted into those 2 files is incorrect? Can anyone maybe try to do the steps outlined in the Developer Docs and see if they can get it working?
Thanks, Dan