From 74b4ae30f9adc77972e1e3d4080e87771fb6da3e Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 12 Sep 2026 12:15:08 +0100 Subject: [PATCH] fix(react-widget): drop the stranded 'use client' directive Parcel's library build concatenates modules, so the directive at the top of DocsGPTWidget.tsx landed a thousand lines into dist/module.js and dist/main.js. webpack rejects a 'use client' that is not the first expression in the file, which broke every Next.js consumer of docsgpt-react: x The "use client" directive must be placed before other expressions. 1168 | 'use client'; The directive could not do its job from inside a bundle anyway. A React Server Components boundary has to be declared by the importing module, so consumers wrap the widget in their own client component instead. --- extensions/react-widget/src/components/DocsGPTWidget.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/extensions/react-widget/src/components/DocsGPTWidget.tsx b/extensions/react-widget/src/components/DocsGPTWidget.tsx index 7af67307..94f09fd2 100644 --- a/extensions/react-widget/src/components/DocsGPTWidget.tsx +++ b/extensions/react-widget/src/components/DocsGPTWidget.tsx @@ -1,4 +1,3 @@ -'use client'; import React, { useRef } from 'react'; import DOMPurify from 'dompurify'; import styled, { keyframes, css } from 'styled-components';