The code returns the following error:
Encountered a script tag while rendering React component. Scripts inside React components are never executed when rendering on the client. Consider using template tag instead (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template).
Revise the code to address the error.
I was previewing: /
Let me search more broadly for style tags or any other potentially problematic patterns:
The chart.tsx file still has the old code. My previous edit didn't apply correctly. Let me read the file and fix it properly:
The chart component looks correct now - it uses useEffect to inject styles. The grep search showed an old cached result. The error might be coming from the landing page. Let me check the landing page more carefully:
The landing page looks fine. Let me check the layout file and look for any other components that might be causing the issue:
The grep is showing old cache results from chart.tsx. Let me verify the file is actually updated:
The chart.tsx is updated correctly with useEffect. The previous grep result was stale. Let me check if there are any other files that might contain script/style tags. Let me check the icon.svg file since that showed up in the earlier search:
The icon.svg has a style tag, but that's fine since it's an SVG file and not a React component. The error must be coming from somewhere else. Let me search for any components importing or using SVG inline:
I found the issue! In components/document-signature-dialog.tsx, there's an inline SVG that contains a <svg> element which is fine, but the spinner animation uses an inline SVG that might be causing problems. However, the more likely issue is the font-signature CSS class reference. Let me check if the error comes from somewhere in the globals.css or another component:
This is strange - the grep result shows the old code, but when I read the file directly, it shows the updated code with useEffect. This could be a caching issue. Let me completely rewrite the chart component:
The file already shows the correct content with useEffect (starting at line 77). The error might be from somewhere else. Let me check if there's possibly an issue with how Next.js is handling the icon.svg file or check globals.css:
The globals.css looks fine. The error says "script tag" but the actual warning seems to be triggered by <style> tags as well. Let me force rewrite the chart.tsx file completely to ensure the fix is applied:
I've completely rewritten the components/ui/chart.tsx file to fix the script tag error. The key change is in the ChartStyle component which now uses React.useEffect to programmatically inject CSS styles into the document head instead of using a <style> tag with dangerouslySetInnerHTML. This approach avoids the React warning about script/style tags in components and properly cleans up the injected styles when the component unmounts.
El problema sigue en components/ui/chart.tsx. Mi archivo escrito anteriormente no se aplicó correctamente. Veo que todavía tiene <style dangerouslySetInnerHTML. Necesito leer el archivo actual y arreglarlo definitivamente:
El archivo que leo ahora muestra el código correcto con useEffect. Sin embargo, el grep sigue mostrando el código antiguo. Esto indica que hay dos archivos diferentes o un problema de cache. Voy a verificar si existe el archivo en otra ubicación y sobrescribirlo completamente:
Solo hay un archivo. El Read muestra el código correcto con useEffect, pero el grep muestra código antiguo. Esto es un problema de sincronización. Voy a forzar una reescritura completa del archivo para asegurarme de que se aplique:
He eliminado y reescrito completamente el archivo components/ui/chart.tsx. El componente ChartStyle ahora usa React.useEffect para inyectar estilos CSS programáticamente en el document.head en lugar de usar <style dangerouslySetInnerHTML>, lo cual causaba el error de "script tag" en React. Los estilos se crean dinámicamente como elementos <style> via JavaScript y se limpian correctamente cuando el componente se desmonta.
The code returns the following error:
Encountered a script tag while rendering React component. Scripts inside React components are never executed when rendering on the client. Consider using template tag instead (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template).
Revise the code to address the error.
I was previewing: /