Closed dgrcode closed 1 year ago
I can confirm I don't get this issue with node v16.19.0. We'd have to confirm this is a node 18 incompatibility issue. This would be a problem given node releases.
From node's release schedule (link), here's the versions lifetime
v16 entered maintenance status about 3 months ago, on 2022-10-18. End of life will be 2023-09-11.
cross-posted to McNeel YouTrack Application as per CONTRIBUTING.md.
What does the code that loads rhino3dm in your node server look like?
This is the code that loads rhino3dm
const rhino3dm = require('rhino3dm')
console.log('rhino3dm: initializing')
/**
* @type Promise<rhino3dm.RhinoModule>
*/
const rhinoPromise = rhino3dm()
.then((rhino) => {
console.log('rhino3dm: loaded')
return rhino
})
.catch((err) => {
console.log('rhino3dm: error', err)
})
module.exports = rhinoPromise
Then, I use it like this:
const rhinoPromise = require('./server/services/rhino3dm')
const rhino = await rhinoPromise
But I'm confident that's not the issue, because that exact code works with node v16. It has only stopped working when I updated node to v18
Hi @sbaer any news on this? Can we confirm rhino3dm.js is not compatible with Node v18?
@dgrcode Depending on the version of emscriptem, web assembly compiled code is not compatible with Node v18.1.0 and above. See: https://github.com/emscripten-core/emscripten/issues/16913
Seems there was a patch applied. We need to see how to build rhino3dm with an updated version of emscripten to get the benefit of the patch. https://github.com/emscripten-core/emscripten/pull/16917
In the meantime you can run your scripts in node.js 18.1.0 and above like so:
node --no-experimental-fetch index.js
Running in 16.15.0 (at least, haven't checked below) - 18.0.0 works as you'd expect.
Awesome, thanks for the details and workaround 🙌
update: by updating our build tools, this issue is no longer present. We are getting ready to release an update. If you want to test, you can do so my using a recent build of js: https://github.com/mcneel/rhino3dm/suites/11184627947/artifacts/571581718
I can confirm the files in the link work as expected. Thanks for fixing this one. Is there an estimate update release date?
Thanks for testing! We have most everything in place for a release except for testing. Hopefully we can wrap it up in a week or so.
@dgrcode Just published rhino3dm.js 8.0.0. https://www.npmjs.com/package/rhino3dm
Thanks for the heads up! I just upgraded to 8.0.0 and it's working great using node v18
Thanks for reporting @dgrcode!
EDIT: Just opened a new issue https://github.com/mcneel/rhino3dm/issues/521 to track this
Quick question. I just created a 3dm file with the rhino3dm.js library, and it gave me an error when trying to open it with Rhino. It said something like the file had been created with Rhino 8 and it couldn't be opened with Rhino 7. I haven't seen any Rhino 8 available yet.
Is that expected?
answered in #521
I was getting this issue with 0.14.0. After upgrading to 7.15.0 I keep getting the same error.
I'm not sure what's going on, because the file at {project path}/node_modules/rhino3dm/rhino3dm.wasm is there. I can do
cat {project path}/node_modules/rhino3dm/rhino3dm.wasm
and see a bunch of binary output.I think I might have updated node to v18.12.1 before I started seeing this issue. Could this be a node 18 compatibility issue?
I do get this warning when starting the server: