Next.js Discord

Discord Forum

Jest: cannot find module ai/rsc

Unanswered
Asiatic Lion posted this in #help-forum
Open in Discord
Asiatic LionOP
Hello devs, I am facing this issue which I struggle to find a solution: https://github.com/vercel/ai/issues/1649
Did someone reproduce this same issue?
Thank you for your help!

2 Replies

@Asiatic Lion Hello devs, I am facing this issue which I struggle to find a solution: https://github.com/vercel/ai/issues/1649 Did someone reproduce this same issue? Thank you for your help!
English Spot
I've been having this issue as well. I'm building a chatbot assistant that answers questions about a streaming service I use to release music, and while the "import { createStreamableValue } from 'ai/rsc'" statement doesn't throw any compiler errors and my code implements createStreamableValue without any problems, for whatever reason my webpack build doesn't like it at all. I've gotten the project to finish the build, but the contents of my api folder aren't getting picked up properly. I did end up going to the rsc-client.mjs file and found that createStreamableValue wasn't being imported into the file or exported to the wider project, so there might be another thing like that somewhere I'm not finding, but it's been a headache and a half.

The relevant output is:

TERMINAL:

./app/ai_sdk/agent/audiusAgentServer.ts
Attempted import error: 'createStreamableValue' is not exported from 'ai/rsc' (imported as 'createStreamableValue').

Import trace for requested module:
./app/ai_sdk/agent/audiusAgentServer.ts
./app/ai_sdk/agent/audiusAgent.ts
./components/ChatWindow.tsx

./node_modules/@audius/sdk/dist/index-10482221.js
Module not found: Can't resolve './bindings' in '(some local user directories)/atris/audius-tools/node_modules/@audius/sdk/dist'

Import trace for requested module:
./node_modules/@audius/sdk/dist/index-10482221.js
./node_modules/@audius/sdk/dist/index.browser.esm.js
./app/ai_sdk/agent/audiusAgent.ts
./components/ChatWindow.tsx

(1/2)
(2/2)

Route (app) Size First Load JS
┌ ○ / 160 B 1.02 MB
├ ○ /_not-found 875 B 88.4 kB
├ ○ /agents 160 B 1.02 MB
├ ○ /ai_sdk 142 B 87.6 kB
├ ○ /ai_sdk/agent 2.87 kB 1.02 MB
├ ○ /ai_sdk/tools 1.66 kB 89.1 kB
├ ƒ /api/audius 0 B 0 B
├ ƒ /api/chat 0 B 0 B
├ ƒ /api/chat/agents 0 B 0 B
├ ƒ /api/chat/retrieval 0 B 0 B
├ ƒ /api/chat/retrieval_agents 0 B 0 B
├ ƒ /api/chat/structured_output 0 B 0 B
├ ƒ /api/retrieval/ingest 0 B 0 B
├ ○ /landingpage 142 B 87.6 kB
├ ○ /retrieval 159 B 1.02 MB
├ ○ /retrieval_agents 160 B 1.02 MB
└ ○ /structured_output 160 B 1.02 MB
+ First Load JS shared by all 87.5 kB
├ chunks/23-18926ca9d29ea37f.js 31.7 kB
├ chunks/fd9d1056-3507e44202759132.js 53.6 kB
└ other shared chunks (total) 2.1 kB


○ (Static) prerendered as static content
ƒ (Dynamic) server-rendered on demand

@Asiatic Lion did you ever figure this out?