You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On my nextjs project, when I upgrade to 3.1.32, I get an error when browsing the weather.tsx example code
... However, it works if I downgrade to 3.1.31
Code example
from your docs (PR)
'use client';
import { useState } from 'react';
import { Button } from '@/components/ui/button';
import { streamComponent } from './actions';
export default function Page() {
const [component, setComponent] = useState<React.ReactNode>();
return (
<div>
<form
onSubmit={async e => {
e.preventDefault();
setComponent(await streamComponent());
}}
>
<Button>Stream Component</Button>
</form>
<div>{component}</div>
</div>
);
}
'use server';
import { streamUI } from 'ai/rsc';
import { openai } from '@ai-sdk/openai';
import { z } from 'zod';
const LoadingComponent = () => (
<div className="animate-pulse p-4">getting weather...</div>
);
const getWeather = async (location: string) => {
await new Promise((resolve) => setTimeout(resolve, 2000));
return '82°F️ ☀️';
};
interface WeatherProps {
location: string;
weather: string;
}
const WeatherComponent = (props: WeatherProps) => (
<div className="border border-neutral-200 p-4 rounded-lg max-w-fit">
The weather in {props.location} is {props.weather}
</div>
);
export async function streamComponent() {
const result = await streamUI({
model: openai('gpt-3.5-turbo'),
prompt: 'Get the weather for San Francisco',
text: ({ content }) => <div>{content}</div>,
tools: {
getWeather: {
description: 'Get the weather for a location',
parameters: z.object({
location: z.string()
}),
generate: async function* ({ location }) {
yield <LoadingComponent />;
const weather = await getWeather(location);
return <WeatherComponent weather={weather} location={location} />;
}
}
}
});
return result.value;
}
/weather/page.tsx and /weather/actions.tsx
Additional context
✓ Compiled in 544ms (804 modules)
⨯ Internal error: Error: Could not find the module "/home/fullstack/dev/freegpt.today/node_modules/.pnpm/ai@3.1.32_openai@4.51.0_react@18.3.1_solid-js@1.8.17_svelte@4.2.18_vue@3.4.27_typescript@5.4.5__zod@3.23.8/node_modules/ai/rsc/dist/rsc-shared.mjs#InternalStreamableUIClient" in the React Client Manifest. This is probably a bug in the React Server Components bundler.
at /home/fullstack/dev/freegpt.today/node_modules/.pnpm/next@14.2.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:267034
at eN (/home/fullstack/dev/freegpt.today/node_modules/.pnpm/next@14.2.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:267229)
at eF (/home/fullstack/dev/freegpt.today/node_modules/.pnpm/next@14.2.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:268895)
at /home/fullstack/dev/freegpt.today/node_modules/.pnpm/next@14.2.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:265943
at Array.toJSON (/home/fullstack/dev/freegpt.today/node_modules/.pnpm/next@14.2.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:266407)
at stringify (<anonymous>)
at eq (/home/fullstack/dev/freegpt.today/node_modules/.pnpm/next@14.2.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:274775)
at eJ (/home/fullstack/dev/freegpt.today/node_modules/.pnpm/next@14.2.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:275293)
at Timeout._onTimeout (/home/fullstack/dev/freegpt.today/node_modules/.pnpm/next@14.2.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:265080)
at listOnTimeout (node:internal/timers:573:17)
at process.processTimers (node:internal/timers:514:7)
digest: "413202499"
POST /weather 200 in 2650ms
The text was updated successfully, but these errors were encountered:
Description
On my nextjs project, when I upgrade to 3.1.32, I get an error when browsing the weather.tsx example code
... However, it works if I downgrade to 3.1.31
Code example
from your docs (PR)
/weather/page.tsx and /weather/actions.tsx
Additional context
The text was updated successfully, but these errors were encountered: