Open hopezh opened 6 months ago
Please try with rhino3dm@8.4.0
as there is an issue with 8.6.0. I've since deprecated 8.6.0 and made 8.4.0 latest
.
I am preparing an 8.6.1 release for js. If you can test this package, I would really appreciate it: https://github.com/mcneel/rhino3dm/actions/runs/9017758138/artifacts/1487757185
https://www.npmjs.com/package/rhino3dm/v/8.6.1 has been published which should resolve this issue. Please let me know if that is not the case.
Thanks, @fraguada.
I still got the following error while running the example code on the latest npm repo of rhino3dm, and the test code is in this repo.
(BTW, I init the test repo with npm create vite@latest
.)
npm run dev
> test_rhino3dm_js@0.0.0 dev
> vite
VITE v5.2.11 ready in 217 ms
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
➜ press h + enter to show help
✘ [ERROR] Could not resolve "ws"
node_modules/rhino3dm/rhino3dm.js:9:64363:
9 │ ...r(26)},listen:function(sock,backlog){if(!ENVIRONMENT_IS_NODE){throw new FS.ErrnoError(138)}if(sock.server){throw new FS.ErrnoError(28)}var WebSocketServer=require("ws").Server;var host=sock.saddr;sock.server=new WebSocketServer({host:host,port:sock.sport});Module["websocket"].emit("listen",sock.stream.fd);sock.server.on("connec...
╵ ~~~~
You can mark the path "ws" as external to exclude it from the bundle, which will remove this error
and leave the unresolved path in the bundle. You can also surround this "require" call with a
try/catch block to handle this failure at run-time instead of bundle-time.
npm list
:> npm list
test_rhino3dm_js@0.0.0 C:\Users\jizha\Downloads\code\test_rhino3dm_js
+-- rhino3dm@8.6.1
`-- vite@5.2.11
Unfortunately I don't know anything about vite, so don't know how to help. I'll try running vite to see if I can figure out the issue.
any updates on this issue? I'm running into the same error. vite@latest : Typescript+SWC
I was facing the same issue, but after upgrading to ws
version 8.18.0, the issue was resolved.
@hopezh @jdev-chicago Can you check if updating ws to 8.18.0 as @mr07s suggested works for you?
I got the following error while running the example code rhino3dm.js.
I don't know how to
...mark the path "ws" as external to exclude it from the bundle
, as suggested in the error message.May I ask if I have missed something important here?
The output of my
npm list
: