мой tsx код: 'use client' import React, { useState, createContext, useContext } from…
- User
мой tsx код:
'use client'
import React, { useState, createContext, useContext } from 'react'; import { Flame, Shield, Leaf, Headphones, Rocket, Puzzle, Home, Newspaper, Server, LogIn, Globe2, Plus, Minus, ShoppingCart, MessageCircle, Users, FileText, ExternalLink } from 'lucide-react';
// Create a context for language const LanguageContext = createContext({ language: 'en', setLanguage: (lang: string) => {} });
// Language data const languageData = { en: { nav: { home: 'Home', news: 'News', support: 'Support', serverStatus: 'Server status', personalArea: 'Personal area' }, hero: { announcement: '🇩🇪 Launched VDS sales in Germany location!', findMore: 'Find more', title: 'Perfect hosting for', titleHighlight: 'your project', subtitle: 'turn your fantasies into reality and conquer peaks with us', cta: 'Go to services' }, features: { title: 'Why We?', items: [ { title: 'Fast Servers', description: 'We use the most modern high-frequency processors that guarantee maximum performance for your server.' }, { title: 'DDoS Protection', description: 'All servers have a low-latency network with a 1+ Gbps channel. Paid plans come with powerful DDoS protection.' }, { title: 'Reliable Data Centers', description: 'Servers are located in data centers "InterXion" and "MMTS-9", which meet the highest standards with full physical and hardware protection.' }, { title: 'Quick Support', description: 'Our support team is ready to help you at any time and consult you on any issue. We work 24/7.' }, { title: 'Minimal Ping', description: 'Our nodes are located in Germany and Moscow, which contributes to low ping and latency during gameplay.' }, { title: 'Mod Support', description: 'We support both plugins and mods. Their number is unlimited. You can bring your most interesting ideas to life!' } ] }, services: { title: 'Our services', subtitle: 'check out the range of our services', tabs: [ { id: 'gaming', name: 'Gaming servers' }, { id: 'vds', name: 'VDS servers' }, { id: 'ddos', name: 'DDoS protection' } ], buy: 'Buy' }, faq: { title: 'Frequently Asked Questions', items: [ { question: 'What payment methods do you accept?', answer: 'We accept various payment methods including credit cards, PayPal, and cryptocurrency.' }, { question: 'How quickly can I get my server?', answer: 'Servers are typically provisioned within minutes after confirmed payment.' }, { question: 'Do you offer 24/7 support?', answer: 'Yes, our support team is available 24/7 to assist you with any issues or questions.' } ] }, contact: { title: 'Have questions? Need help?', subtitle: 'Contact support through any convenient service or through your personal area' }, footer: { copyright: 'Aurorix, 2024. All rights reserved.', columns: [ { title: 'General', links: [ { text: 'Home page', href: '#' }, { text: 'Services', href: '#' }, { text: 'News', href: '#' }, ] }, { title: 'Legal information', links: [ { text: 'Terms of use', href: '#' }, { text: 'Privacy policy', href: '#' }, ] }, { title: 'Social media', links: [ { text: 'VK', href: '#' }, { text: 'Telegram', href: '#' }, { text: 'Discord', href: '#' }, ] } ] } }, ru: { nav: { home: 'Главная', news: 'Новости', support: 'Поддержка', serverStatus: 'Статус серверов', personalArea: 'Личный кабинет' }, hero: { announcement: '🇩🇪 Запущены продажи VDS в локации Германия!', findMore: 'Узнать больше', title: 'Идеальный хостинг для', titleHighlight: 'вашего проекта', subtitle: 'воплощайте свои фантазии в реальность и покоряйте вершины вместе с нами', cta: 'Перейти к услугам' }, features: { title: 'Почему мы?', items: [ { title: 'Быстрые серверы', description: 'Мы используем самые современные высокочастотные процессоры, которые гарантируют максимальную производительность вашего сервера.' }, { title: 'DDoS защита', description: 'Все серверы имеют низколатентную сеть с каналом 1+ Гбит/с. Платные тарифы оснащены мощной DDoS защитой.' }, { title: 'Надежные дата-центры', description: 'Серверы расположены в дата-центрах "InterXion" и "ММТС-9", которые соответствуют высочайшим стандартам с полной физической и аппаратной защитой.' }, { title: 'Быстрая поддержка', description: 'Наша команда поддержки готова помочь вам в любое время и проконсультировать по любому вопросу. Мы работаем 24/7.' }, { title: 'Минимальный пинг', description: 'Наши узлы расположены в Германии и Москве, что способствует низкому пингу и задержкам во время игры.' }, { title: 'Поддержка модов', description: 'Мы поддерживаем как плагины, так и моды. Их количество не ограничено. Вы можете воплотить в жизнь свои самые интересные идеи!' } ] }, services: { title: 'Наши услуги', subtitle: 'ознакомьтесь с нашим ассортиментом услуг', tabs: [ { id: 'gaming', name: 'Игровые серверы' }, { id: 'vds', name: 'VDS серверы' }, { id: 'ddos', name: 'DDoS защита' } ], buy: 'Купить' }, faq: { title: 'Часто задаваемые вопросы', items: [ { question: 'Какие способы оплаты вы принимаете?', answer: 'Мы принимаем различные способы оплаты, включая кредитные карты, PayPal и криптовалюту.' }, { question: 'Как быстро я могу получить свой сервер?', answer: 'Серверы обычно предоставляются в течение нескольких минут после подтверждения оплаты.' }, { question: 'Предоставляете ли вы поддержку 24/7?', answer: 'Да, наша команда поддержки доступна 24/7, чтобы помочь вам с любыми вопросами или проблемами.' } ] }, contact: { title: 'Есть вопросы? Нужна помощь?', subtitle: 'Свяжитесь с поддержкой через любой удобный сервис или через личный кабинет' }, footer: { copyright: 'Aurorix, 2024. Все права защищены.', columns: [ { title: 'Общее', links: [ { text: 'Главная страница', href: '#' }, { text: 'Услуги', href: '#' }, { text: 'Новости', href: '#' }, ] }, { title: 'Юридическая информация', links: [ { text: 'Условия использования', href: '#' }, { text: 'Политика конфиденциальности', href: '#' }, ] }, { title: 'Социальные сети', links: [ { text: 'ВКонтакте', href: '#' }, { text: 'Телеграм', href: '#' }, { text: 'Дискорд', href: '#' }, ] } ] } } };
const HostingLandingPage: React.FC = () => { const [activeTab, setActiveTab] = useState('gaming'); const [language, setLanguage] = useState('en'); const [faqs, setFaqs] = useState(languageData.en.faq.items.map(item => ({ ...item, isOpen: false })));
const toggleLanguage = () => { setLanguage(language === 'en' ? 'ru' : 'en'); setFaqs(languageData[language === 'en' ? 'ru' : 'en'].faq.items.map(item => ({ ...item, isOpen: false }))); };
const toggleFaq = (index: number) => { setFaqs(faqs.map((faq, i) => i === index ? { ...faq, isOpen: !faq.isOpen } : faq )); };
const t = languageData[language];
const features = [ { icon: Flame, ...t.features.items[0] }, { icon: Shield, ...t.features.items[1] }, { icon: Leaf, ...t.features.items[2] }, { icon: Headphones, ...t.features.items[3] }, { icon: Rocket, ...t.features.items[4] }, { icon: Puzzle, ...t.features.items[5] } ];
const tabs = [ { id: 'gaming', name: t.services.tabs[0].name, icon: Leaf }, { id: 'vds', name: t.services.tabs[1].name, icon: Rocket }, { id: 'ddos', name: t.services.tabs[2].name, icon: Shield } ];
const allPlans = [ { id: 1, name: 'Древний страж', specs: ['950% CPU', '12GB DDR4', '128GB NVMe'], price: '561', type: 'gaming' }, { id: 2, name: 'Иссушитель', specs: ['1050% CPU', '16GB DDR4', '256GB NVMe'], price: '719', type: 'gaming' }, { id: 3, name: 'VDS Starter', specs: ['2 vCPU', '4GB RAM', '50GB SSD'], price: '299', type: 'vds' }, { id: 4, name: 'VDS Pro', specs: ['4 vCPU', '8GB RAM', '100GB SSD'], price: '599', type: 'vds' }, { id: 5, name: 'Basic Protection', specs: ['Up to 10 Gbps', '24/7 Monitoring'], price: '199', type: 'ddos' }, { id: 6, name: 'Advanced Protection', specs: ['Up to 100 Gbps', 'Real-time mitigation'], price: '499', type: 'ddos' } ];
const filteredPlans = allPlans.filter(plan => plan.type === activeTab);
const socials = [ { name: 'vk', link: '#', icon: MessageCircle }, { name: 'telegram', link: '#', icon: ExternalLink }, { name: 'discord', link: '#', icon: Users }, { name: t.nav.personalArea, link: '#', icon: LogIn } ];
return ( <LanguageContext.Provider value={{ language, setLanguage }}> {/* Background Effects */}
{/* Navigation */} <nav className="fixed w-full z-50 bg-gradient-to-r from-black/95 to-gray-900/95 backdrop-blur-sm border-b border-white/5"> <div className="container mx-auto px-6"> <div className="flex items-center justify-between h-16"> <div className="flex items-center space-x-12"> {/* Logo */} <a href="#" className="text-2xl font-bold"> <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M16 2L30 28H2L16 2Z" fill="currentColor"/> </svg> </a> {/* Nav Links */} <div className="hidden md:flex items-center space-x-8"> <a href="#" className="flex items-center space-x-2 text-white"> <Home className="w-4 h-4" /> <span>{t.nav.home}</span> </a> <a href="#" className="flex items-center space-x-2 text-gray-400 hover:text-white transition-colors duration-200"> <Newspaper className="w-4 h-4" /> <span>{t.nav.news}</span> </a> <a href="#" className="flex items-center space-x-2 text-gray-400 hover:text-white transition-colors duration-200"> <Headphones className="w-4 h-4" /> <span>{t.nav.support}</span> </a> <a href="#" className="flex items-center space-x-2 text-gray-400 hover:text-white transition-colors duration-200"> <Server className="w-4 h-4" /> <span>{t.nav.serverStatus}</span> </a> </div> </div> {/* Right Side */} <div className="flex items-center space-x-6"> <button onClick={toggleLanguage} className="flex items-center space-x-2 text-gray-400 hover:text-white transition-colors duration-200"> <Globe2 className="w-5 h-5" /> <span>{language.toUpperCase()}</span> </button> <button className="px-6 py-2 bg-[#7C3AED] hover:bg-[#6D28D9] text-white rounded-full transition-all duration-200 flex items-center space-x-2"> <LogIn className="w-4 h-4" /> <span>{t.nav.personalArea}</span> </button> </div> </div> </div> </nav> {/* Hero Section */} <section className="relative min-h-screen flex items-center pt-20 bg-gradient-to-b from-black via-gray-900/50 to-black"> <div className="container mx-auto px-6"> <div className="grid md:grid-cols-2 gap-12 items-center"> <div className="space-y-6"> <div className="inline-block px-4 py-2 bg-purple-900/30 rounded-full text-sm"> {t.hero.announcement} <a href="#" className="text-purple-400 ml-2 hover:underline">{t.hero.findMore}</a> </div> <h1 className="text-5xl md:text-6xl font-bold leading-tight"> {t.hero.title} <span className="text-transparent bg-clip-text bg-gradient-to-r from-purple-400 to-blue-400"> {t.hero.titleHighlight}</span> </h1> <p className="text-gray-400 text-xl"> {t.hero.subtitle} </p> <button className="px-8 py-4 bg-[#7C3AED] hover:bg-[#6D28D9] text-white rounded-full transition-all duration-200 flex items-center space-x-2"> <Rocket className="w-5 h-5" /> <span>{t.hero.cta}</span> </button> </div> <div className="relative hidden md:block"> <div className="absolute inset-0 bg-gradient-to-r from-purple-600/20 to-blue-600/20 rounded-full filter blur-3xl"></div> <img src="/placeholder.svg?height=600&width=600" alt="Decorative" className="relative z-10 animate-float" /> </div> </div> </div> </section> {/* Features Section */} <section className="py-20 bg-gradient-to-b from-black via-gray-900/50 to-black relative overflow-hidden"> <div className="container mx-auto px-6 relative z-10"> <h2 className="text-4xl font-bold mb-12 text-center">{t.features.title}</h2> <div className="grid md:grid-cols-3 gap-8"> {features.map((feature, index) => ( <div key={index} className="p-6 rounded-xl bg-white/5 hover:bg-white/10 transition-all duration-300 ease-in-out transform hover:scale-105 hover:shadow-lg hover:shadow-purple-500/25"> <div className="w-12 h-12 bg-gradient-to-br from-purple-600 to-blue-600 rounded-lg flex items-center justify-center mb-4"> <feature.icon className="w-6 h-6" /> </div> <h3 className="text-xl font-bold mb-2">{feature.title}</h3> <p className="text-gray-400">{feature.description}</p> </div> ))} </div> </div> </section> {/* Services Section */} <section className="py-20 bg-gradient-to-b from-black via-gray-900/50 to-black relative overflow-hidden"> <div className="container mx-auto px-6 relative z-10"> <h2 className="text-4xl font-bold mb-2 text-center">{t.services.title}</h2> <p className="text-gray-400 mb-8 text-center">{t.services.subtitle}</p> {/* Service Tabs */} <div className="flex flex-wrap justify-center gap-4 mb-8"> {tabs.map(tab => ( <button key={tab.id} onClick={() => setActiveTab(tab.id)} className={`px-6 py-3 rounded-full transition-all duration-200 ${ activeTab === tab.id ? 'bg-[#7C3AED] text-white' : 'bg-white/5 text-gray-400 hover:bg-white/10' }`}> <span className="flex items-center gap-2"> <tab.icon className="w-5 h-5" /> {tab.name} </span> </button> ))} </div> {/* Server Plans */} <div className="space-y-4"> {filteredPlans.map(plan => ( <div key={plan.id} className="p-6 rounded-xl bg-white/5 hover:bg-white/10 transition-all duration-300 ease-in-out transform hover:scale-105"> <div className="flex items-center justify-between"> <div className="flex items-center space-x-4"> <span className="text-xl font-bold">{plan.name}</span> <div className="flex space-x-2"> {plan.specs.map((spec, index) => ( <span key={index} className="px-3 py-1 bg-white/5 rounded-full text-sm">{spec}</span> ))} </div> </div> <div className="flex items-center space-x-4"> <span className="text-2xl font-bold text-transparent bg-clip-text bg-gradient-to-r from-purple-400 to-blue-400">{plan.price}₽</span> <button className="px-6 py-2 bg-[#7C3AED] hover:bg-[#6D28D9] text-white rounded-full transition-all duration-200 flex items-center space-x-2"> <ShoppingCart className="w-4 h-4" /> <span>{t.services.buy}</span> </button> </div> </div> </div> ))} </div> </div> </section> {/* FAQ Section */} <section className="py-20 bg-gradient-to-b from-black via-gray-900/50 to-black relative overflow-hidden"> <div className="container mx-auto px-6 relative z-10"> <h2 className="text-4xl font-bold mb-12 text-center">{t.faq.title}</h2> <div className="max-w-3xl mx-auto"> {faqs.map((faq, index) => ( <div key={index} className="mb-6"> <div onClick={() => toggleFaq(index)} className="flex justify-between items-center p-4 bg-white/5 hover:bg-white/10 rounded-lg cursor-pointer transition-colors duration-200"> <h3 className="text-lg font-semibold">{faq.question}</h3> {faq.isOpen ? <Minus className="w-5 h-5" /> : <Plus className="w-5 h-5" />} </div> {faq.isOpen && ( <p className="p-4 bg-white/5 rounded-b-lg mt-1">{faq.answer}</p> )} </div> ))} </div> </div> </section> {/* Contact Section */} <section className="py-20 relative overflow-hidden"> <div className="absolute inset-0 bg-cover bg-center" style={{backgroundImage: "url('https://img.freepik.com/premium-photo/mount-fuji-japan-generative-ai_779468-12363.jpg')"}}></div> <div className="absolute inset-0 bg-gradient-to-b from-black/80 via-black/70 to-black/80"></div> <div className="container mx-auto px-6 relative z-10 text-center"> <h2 className="text-4xl font-bold mb-4">{t.contact.title}</h2> <p className="text-gray-300 mb-8"> {t.contact.subtitle} </p> <div className="flex flex-wrap justify-center gap-4"> {socials.map(social => ( <a key={social.name} href={social.link} className="px-6 py-3 bg-white/10 hover:bg-white/20 rounded-full transition-all duration-200 flex items-center space-x-2"> <social.icon className="w-5 h-5" /> <span>{social.name}</span> </a> ))} </div> </div> </section> {/* Footer */} <footer className="py-12 border-t border-white/10 bg-gradient-to-b from-black to-gray-900 relative overflow-hidden"> <div className="container mx-auto px-6 relative z-10"> <div className="grid md:grid-cols-4 gap-8"> <div> <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg" className="mb-4"> <path d="M16 2L30 28H2L16 2Z" fill="currentColor"/> </svg> <p className="text-gray-400">{t.footer.copyright}</p> </div> {t.footer.columns.map((column, index) => ( <div key={index}> <h3 className="font-bold mb-4">{column.title}</h3> <ul className="space-y-2 text-gray-400"> {column.links.map((link, linkIndex) => ( <li key={linkIndex}> <a href={link.href} className="hover:text-purple-400 transition-colors duration-200 flex items-center space-x-2"> <span>{link.text}</span> </a> </li> ))} </ul> </div> ))} </div> </div> </footer> </div> </LanguageContext.Provider>); };
export default HostingLandingPage;
ошибка:
⚠ ./app/page.tsx Attempted import error: 'HostingLandingPage' is not exported from '@/components/hosting-landing-page' (imported as 'HostingLandingPage').
Import trace for requested module: ./app/page.tsx React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports. ⨯ Internal error: Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports. at renderElement (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:135440) at retryNode (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:140127) at renderNodeDestructive (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:136532) at renderNode (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:149248) at renderChildrenArray (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:146711) at retryNode (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:140521) at renderNodeDestructive (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:136532) at renderElement (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:128298) at retryNode (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:140127) at renderNodeDestructive (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:136532) at renderElement (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:133451) at retryNode (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:140127) at renderNodeDestructive (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:136532) at finishFunctionComponent (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:67962) at renderElement (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:83161) at retryNode (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:140127) at renderNodeDestructive (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:136532) at renderElement (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:81131) at retryNode (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:140127) at renderNodeDestructive (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:136532) at finishFunctionComponent (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:67962) at renderElement (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:83161) at retryNode (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:140127) at renderNodeDestructive (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:136532) at renderElement (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:81131) at retryNode (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:140127) at renderNodeDestructive (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:136532) at finishFunctionComponent (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:67962) at renderElement (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:83161) at retryNode (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:140127) at renderNodeDestructive (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:136532) at renderElement (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:128298) at retryNode (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:140127) at renderNodeDestructive (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:136532) at finishFunctionComponent (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:67962) at renderElement (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:83161) at retryNode (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:140127) at renderNodeDestructive (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:136532) at renderElement (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:128298) at retryNode (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:140127) at renderNodeDestructive (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:136532) at finishFunctionComponent (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:67962) at renderElement (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:83161) at retryNode (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:140127) at renderNodeDestructive (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:136532) at renderElement (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:81131) at retryNode (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:140127) at renderNodeDestructive (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:136532) at finishFunctionComponent (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:67962) at renderElement (D:\netpclanding\niggers\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:25:83161) digest: "1075076136" GET / 500 in 3619ms ⚠ ./app/page.tsx Attempted import error: 'HostingLandingPage' is not exported from '@/components/hosting-landing-page' (imported as 'HostingLandingPage').
Import trace for requested module: ./app/page.tsx
- Assistant
The error you're encountering indicates that there's a mismatch between how you're exporting your component and how you're importing it. Specifically, you're exporting
HostingLandingPageas a default export, but you're importing it as a named export.Here's the core part of the error message:
Attempted import error: 'HostingLandingPage' is not exported from '@/components/hosting-landing-page' (imported as 'HostingLandingPage'). ... You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.Reason for the Error:
In your
hosting-landing-page.tsxfile, you're exportingHostingLandingPageas a default export:export default HostingLandingPage;However, in your
app/page.tsxfile, you're importing it as a named export (using curly braces):import { HostingLandingPage } from '@/components/hosting-landing-page';This mismatch causes the imported
HostingLandingPageto beundefined, which leads to the error you're seeing.Solution:
You need to align your import with how you've exported the component.
Option 1: Import the default export without curly braces:
Since you're exporting
HostingLandingPageas a default export, you should import it without curly braces.In
app/page.tsx, modify the import statement as follows:import HostingLandingPage from '@/components/hosting-landing-page';Option 2: Export as a named export:
If you prefer to use named imports (with curly braces), you can change your export to a named export.
In
hosting-landing-page.tsx, modify the export statement:export { HostingLandingPage };Recommended Approach:
Stick with the first option to import the default export without curly braces, as it's the simplest fix.
Updated
app/page.tsx:import HostingLandingPage from '@/components/hosting-landing-page'; export default function Page() { return <HostingLandingPage />; }Explanation:
By importing
HostingLandingPagewithout curly braces, you're correctly importing the default export from your component file.
Additional Tips:
- Ensure that your file paths are correct.
- Consistent use of default and named exports/imports helps avoid such errors.
- Always pay attention to whether you're exporting/importing as default or named, and ensure that they match.
Summary:
Change your import statement to match the default export:
// Before: import { HostingLandingPage } from '@/components/hosting-landing-page'; // After: import HostingLandingPage from '@/components/hosting-landing-page';This should resolve the error and allow your application to run correctly.