'use client' import React, { useEffect, useRef, useState } from 'react' export default function SimpleTest() { const chartContainerRef = useRef(null) const [status, setStatus] = useState('Initializing...') useEffect(() => { const initChart = async () => { try { setStatus('Importing library...') // Test if we can import the library const chartModule = await import('lightweight-charts') setStatus('Library imported') // Test if we can extract functions const { createChart } = chartModule setStatus('Functions extracted') if (!chartContainerRef.current) { setStatus('No container element') return } setStatus('Creating chart...') // Create chart with explicit dimensions const chart = createChart(chartContainerRef.current, { width: 800, height: 400, layout: { background: { color: '#1a1a1a' }, textColor: '#ffffff', }, }) setStatus('Chart created') // Add series const series = chart.addCandlestickSeries({ upColor: '#00ff00', downColor: '#ff0000', }) setStatus('Series added') // Add simple data series.setData([ { time: '2025-07-14', open: 100, high: 105, low: 95, close: 102 }, { time: '2025-07-15', open: 102, high: 107, low: 98, close: 104 }, { time: '2025-07-16', open: 104, high: 109, low: 101, close: 106 }, ]) setStatus('Data set - Chart should be visible!') } catch (error) { console.error('Error:', error) setStatus(`Error: ${error}`) } } initChart() }, []) return (

Simple Chart Test

Status: {status}
This red border should help us see if the container is properly sized
Container content - this should be replaced by the chart
Container ref: {chartContainerRef.current ? 'Available' : 'Not available'}
) }