ably-js icon indicating copy to clipboard operation
ably-js copied to clipboard

Project does not build with a current (LTS) version of Node (18+)

Open scottned opened this issue 1 year ago • 5 comments

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.

┆Issue is synchronized with this Jira Task by Unito

scottned avatar Nov 09 '23 15:11 scottned

➤ Automation for Jira commented:

The link to the corresponding Jira issue is https://ably.atlassian.net/browse/SDK-3940

sync-by-unito[bot] avatar Nov 09 '23 15:11 sync-by-unito[bot]

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?

owenpearson avatar Nov 09 '23 16:11 owenpearson

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.

scottned avatar Nov 09 '23 16:11 scottned

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 👍

owenpearson avatar Nov 09 '23 17:11 owenpearson

That was it and your suggestion fixed it. Thanks for being so responsive!

scottned avatar Nov 09 '23 17:11 scottned

Closing this as issue has been resolved, and ably-js v2 project version fully supports and can be built using Node 18+

VeskeR avatar Apr 19 '24 01:04 VeskeR