From 0b2b7ed9c8a80e705819d7f5f4b6ead426094a68 Mon Sep 17 00:00:00 2001 From: Waleed Date: Wed, 28 Jan 2026 23:37:00 -0800 Subject: [PATCH 1/3] fix(oauth): use createElement for icon components to fix React hooks error (#3064) --- .../components/credential-selector/credential-selector.tsx | 4 ++-- .../tool-input/components/tool-credential-selector.tsx | 4 ++-- .../settings-modal/components/integrations/integrations.tsx | 6 ++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/credential-selector/credential-selector.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/credential-selector/credential-selector.tsx index c7f307b13b..d8c905560d 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/credential-selector/credential-selector.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/credential-selector/credential-selector.tsx @@ -1,6 +1,6 @@ 'use client' -import { useCallback, useEffect, useMemo, useState } from 'react' +import { createElement, useCallback, useEffect, useMemo, useState } from 'react' import { createLogger } from '@sim/logger' import { ExternalLink, Users } from 'lucide-react' import { Button, Combobox } from '@/components/emcn/components' @@ -203,7 +203,7 @@ export function CredentialSelector({ if (!baseProviderConfig) { return } - return baseProviderConfig.icon({ className: 'h-3 w-3' }) + return createElement(baseProviderConfig.icon, { className: 'h-3 w-3' }) }, []) const getProviderName = useCallback((providerName: OAuthProvider) => { diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/components/tool-credential-selector.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/components/tool-credential-selector.tsx index d202efb775..28763bb284 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/components/tool-credential-selector.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/components/tool-credential-selector.tsx @@ -1,4 +1,4 @@ -import { useCallback, useEffect, useMemo, useState } from 'react' +import { createElement, useCallback, useEffect, useMemo, useState } from 'react' import { ExternalLink } from 'lucide-react' import { Button, Combobox } from '@/components/emcn/components' import { @@ -22,7 +22,7 @@ const getProviderIcon = (providerName: OAuthProvider) => { if (!baseProviderConfig) { return } - return baseProviderConfig.icon({ className: 'h-3 w-3' }) + return createElement(baseProviderConfig.icon, { className: 'h-3 w-3' }) } const getProviderName = (providerName: OAuthProvider) => { diff --git a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/integrations/integrations.tsx b/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/integrations/integrations.tsx index e02b4c1a50..dabdfc03f8 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/integrations/integrations.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/integrations/integrations.tsx @@ -1,6 +1,6 @@ 'use client' -import { useEffect, useRef, useState } from 'react' +import { createElement, useEffect, useRef, useState } from 'react' import { createLogger } from '@sim/logger' import { Check, ChevronDown, ExternalLink, Search } from 'lucide-react' import { useRouter, useSearchParams } from 'next/navigation' @@ -339,9 +339,7 @@ export function Integrations({ onOpenChange, registerCloseHandler }: Integration >
- {typeof service.icon === 'function' - ? service.icon({ className: 'h-4 w-4' }) - : service.icon} + {createElement(service.icon, { className: 'h-4 w-4' })}
{service.name} From 1256a15266ec4d676791f2c164ec4c9477edb996 Mon Sep 17 00:00:00 2001 From: Waleed Date: Wed, 28 Jan 2026 23:49:57 -0800 Subject: [PATCH 2/3] fix(posthog): move session recording proxy to middleware for large payload support (#3065) Next.js rewrites can strip request bodies for large payloads (1MB+), causing 400 errors from CloudFront. PostHog session recordings require up to 64MB per message. Moving the proxy to middleware ensures proper body passthrough. Co-authored-by: Claude Opus 4.5 --- apps/sim/next.config.ts | 12 ------------ apps/sim/proxy.ts | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/apps/sim/next.config.ts b/apps/sim/next.config.ts index 45f6ffecdf..bbeb57c946 100644 --- a/apps/sim/next.config.ts +++ b/apps/sim/next.config.ts @@ -325,18 +325,6 @@ const nextConfig: NextConfig = { return redirects }, - async rewrites() { - return [ - { - source: '/ingest/static/:path*', - destination: 'https://us-assets.i.posthog.com/static/:path*', - }, - { - source: '/ingest/:path*', - destination: 'https://us.i.posthog.com/:path*', - }, - ] - }, } export default nextConfig diff --git a/apps/sim/proxy.ts b/apps/sim/proxy.ts index 0d9f5aaa85..773700a754 100644 --- a/apps/sim/proxy.ts +++ b/apps/sim/proxy.ts @@ -134,6 +134,24 @@ function handleSecurityFiltering(request: NextRequest): NextResponse | null { export async function proxy(request: NextRequest) { const url = request.nextUrl + if (url.pathname.startsWith('/ingest/')) { + const hostname = url.pathname.startsWith('/ingest/static/') + ? 'us-assets.i.posthog.com' + : 'us.i.posthog.com' + + const targetPath = url.pathname.replace(/^\/ingest/, '') + const targetUrl = `https://${hostname}${targetPath}${url.search}` + + return NextResponse.rewrite(new URL(targetUrl), { + request: { + headers: new Headers({ + ...Object.fromEntries(request.headers), + host: hostname, + }), + }, + }) + } + const sessionCookie = getSessionCookie(request) const hasActiveSession = isAuthDisabled || !!sessionCookie @@ -195,6 +213,7 @@ export async function proxy(request: NextRequest) { export const config = { matcher: [ + '/ingest/:path*', // PostHog proxy for session recording '/', // Root path for self-hosted redirect logic '/terms', // Whitelabel terms redirect '/privacy', // Whitelabel privacy redirect From ae17c90bdf442b555b5695121b5e94e0a15729bd Mon Sep 17 00:00:00 2001 From: Waleed Date: Wed, 28 Jan 2026 23:51:34 -0800 Subject: [PATCH 3/3] chore(readme): update readme.md (#3066) --- README.md | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/README.md b/README.md index 3fa7b7d016..2fc2bef504 100644 --- a/README.md +++ b/README.md @@ -172,31 +172,6 @@ Key environment variables for self-hosted deployments. See [`.env.example`](apps | `API_ENCRYPTION_KEY` | Yes | Encrypts API keys (`openssl rand -hex 32`) | | `COPILOT_API_KEY` | No | API key from sim.ai for Copilot features | -## Troubleshooting - -### Ollama models not showing in dropdown (Docker) - -If you're running Ollama on your host machine and Sim in Docker, change `OLLAMA_URL` from `localhost` to `host.docker.internal`: - -```bash -OLLAMA_URL=http://host.docker.internal:11434 docker compose -f docker-compose.prod.yml up -d -``` - -See [Using an External Ollama Instance](#using-an-external-ollama-instance) for details. - -### Database connection issues - -Ensure PostgreSQL has the pgvector extension installed. When using Docker, wait for the database to be healthy before running migrations. - -### Port conflicts - -If ports 3000, 3002, or 5432 are in use, configure alternatives: - -```bash -# Custom ports -NEXT_PUBLIC_APP_URL=http://localhost:3100 POSTGRES_PORT=5433 docker compose up -d -``` - ## Tech Stack - **Framework**: [Next.js](https://nextjs.org/) (App Router)