ably-js
ably-js copied to clipboard
Project does not build with a current (LTS) version of Node (18+)
When building the project with Node 18, I get this error:
Running "webpack:all" (webpack) task
10% [3] building 0/1 modules 1 active .../snedderman/src/ably-js/src/platform/web/index-webworker.tsFatal error: error:0308010C:digital envelope routines::unsupported
npm ERR! code 3
npm ERR! path /Users/snedderman/src/ably-js
This error can currently be resolved by downgrading to Node 16 which is no longer in support.
Please update the project so it can be built with current versions of Node.
➤ Automation for Jira commented:
The link to the corresponding Jira issue is https://ably.atlassian.net/browse/SDK-3940
Hey @scottned thanks for reaching out!
Unfortunately this is an issue with webpack v4 which we're planning on moving away from in the near future but we're not there yet. For development we've been using the legacy openssl provider to build the library in node 18 when needed, would this work for you? Would also be good to know what you're building the library for - ie. are you installing it via git rather than npm?
I built the library because I was getting a TypeScript error with "AblyProvider" for React. I thought I would take a look at the source code and try to fix it. However, getting an error building the project made me stop.
The "AblyProvider" TS error can be seen using the example code here.
Ah I see, sorry for the inconvenience - if the error you're seeing is Type 'Realtime' is not assignable to type 'RealtimePromise'
then it can be fixed by using Realtime.Promise
in place of Realtime
. I'll get the docs updated, thanks for making us aware of this 👍
That was it and your suggestion fixed it. Thanks for being so responsive!
Closing this as issue has been resolved, and ably-js v2 project version fully supports and can be built using Node 18+