importLayout from '../components/MyLayout.js'importLink from 'next/link'import fetch from 'isomorphic-unfetch'constPosts=(props)=>(<Layout><h1>List of Products</h1><ul>{ props.posts.map((post)=>(<li key={post._id}>{ post.title }</li>))}</ul></Layout>)Products.getInitialProps = async function(){const res = await fetch('/api/psts')const data = await res.json()return{
products: data
}}exportdefaultProducts
لكن عند تحديث الصفحة كل شئ يتوقف وأحصل على هذا الخطأ
السؤال
عبد النور محمد
قمت باتباع مقال حول استخدام express مع nextjs وكل شئ كان يعمل بسلاسة وفي الصفحة تم جلب البيانات
لكن عند تحديث الصفحة كل شئ يتوقف وأحصل على هذا الخطأ
Error: only absolute urls are supported1 جواب على هذا السؤال
Recommended Posts
انضم إلى النقاش
يمكنك أن تنشر الآن وتسجل لاحقًا. إذا كان لديك حساب، فسجل الدخول الآن لتنشر باسم حسابك.