Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Production build doesn't work #13

Open
kinivi opened this issue Sep 10, 2024 · 2 comments
Open

Production build doesn't work #13

kinivi opened this issue Sep 10, 2024 · 2 comments

Comments

@kinivi
Copy link

kinivi commented Sep 10, 2024

with
yarn build
yarn start

When tools results is loading, they blink and then everything disappears. No issues with yarn dev, just with prod build.

@xiaojinwhu
Copy link

I've encountered the same problem.

I'm experiencing an issue where components defined in NODE_COMPONENT_MAP work correctly in the development environment (pnpm dev), but after building and starting the production environment (pnpm build and pnpm start), these components briefly show a loading state, display data momentarily, and then disappear.
This behavior occurs with components like the weather component. The application's behavior is inconsistent between development and production builds.
Steps to Reproduce

  1. Run the application in development mode using pnpm dev. Components render and function as expected.
  2. Build the application for production using pnpm build.
  3. Start the application in production mode using pnpm start.
  4. Observe that components show a loading state, display data briefly, and then disappear.

Attempted Solutions

  • Ensured use client Directive is Present: Verified that all necessary components have the "use client"; directive at the top of their files.
  • Dynamic Import of Components: Used dynamic import for client-side components with next/dynamic and ssr: false.
  • Forced Dynamic Routes: Added export const dynamic = 'force-dynamic'; to pages and API routes to enforce dynamic rendering.

@tichkames
Copy link

tichkames commented Nov 27, 2024

To anyone else experiencing this issue. This is how I fixed mine. Seems stream was getting closed inside agent.tsx handleInvokeToolsEvent and then again outside in server.tsx.

I update my code to just do an update instead inside the agent.tsx. and this resolved it in production. See code snippet here:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants