I'm facing an issue with Ably integration in Next.js App Router where I need serverComponentsExternalPackages: ["ably"] to stop this dev mode warning, related to this issue
⚠ ./node_modules/keyv/src/index.js
Critical dependency: the request of a dependency is an expression
Import trace for requested module:
./node_modules/keyv/src/index.js
./node_modules/cacheable-request/src/index.js
./node_modules/got/dist/source/core/index.js
./node_modules/got/dist/source/create.js
./node_modules/got/dist/source/index.js
./node_modules/ably/build/ably-node.js
and while adding serverComponentsExternalPackages: ["ably"] to next.config does solve these warnings I get another dev mode errors (non-breaking), and build errors (breaking)
Current Implementation:
- Using dynamic imports with
ssr: false for Ably components
- Getting Ably client from API route with authUrl: "/api"
Versions:
- Next.js: 14.2.29
- Ably: 2.9.0
┆Issue is synchronized with this Jira Task by Unito
I'm facing an issue with Ably integration in Next.js App Router where I need
serverComponentsExternalPackages: ["ably"]to stop this dev mode warning, related to this issueand while adding
serverComponentsExternalPackages: ["ably"]to next.config does solve these warnings I get another dev mode errors (non-breaking), and build errors (breaking)dev error (non-breaking):

build error (breaking):

Current Implementation:
ssr: falsefor Ably componentsVersions:
┆Issue is synchronized with this Jira Task by Unito