-
Notifications
You must be signed in to change notification settings - Fork 139
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
[ERROR] Could not resolve "ws" #612
Comments
Please try with |
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 Errornpm 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. my
|
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 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
:+-- rhino3dm@8.6.0 +-- three@0.163.0 `-- vite@5.2.8
The text was updated successfully, but these errors were encountered: