Update README for using ably-js in Next.js 15 #1790
Labels
documentation
Improvements or additions to public interface documentation (API reference or readme).
investigate
Something has changed in Next.js 15 so it's now necessary to load components using ably-js with
next/dynamic
and use'use client';
directive for such components, otherwise we would getWarning: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
errors and possible build issues like in #1788.See working Next.js 15 (RC) example app: https://github.com/VeskeR/ably-js-nextjs-15-example (need to run
npm install --legacy-peer-deps
due to this npm issue and using prerelease version of next.js).And see Next.js 14 app: https://github.com/ably-labs/ably-nextjs-fundamentals-kit. You can remove
'use client';
there and skip loading components usingnext/dynamic
and it would still work.Need to investigate what's changed and update README for using ably-js with Next.js 15.
┆Issue is synchronized with this Jira Task by Unito
The text was updated successfully, but these errors were encountered: