Project from my Next.js crash course on YouTube
npm run dev
npm run build
npm start
GET /api/articles GET /api/articles/:id
Project from my Next.js crash course on YouTube
I completed course and it works on localhost as in the course but when some errors occurred when deploying on vercel as shown in the screenshot. As a self-taught and newbie developer, I couldn't figure it out. May you please help me?
here it is my repo
here it is the error
Thank you for the very helpfull tutorial :)
Unfortunately npm run build
doesn't work on the state of this repository, since it tries to download the articles from https://yourwebsite.com/domains/.
Even changing the server
variable to constantly http://localhost:3000 doesn't help, since the /api/articles/index.js
from the video was not committed.
I believe the ArticleItem.js component needs to be updated to include the "legacyBehavior" prop due to the fact that <a>
tags are used as children. Or needs to be refactored to meet the new Link requirements.
possible solution:
import Link from 'next/link'
import articleStyles from '../styles/Article.module.css'
const ArticleItem = ({ article }) => {
return (
<Link legacyBehavior href={`/article/${article.id}`}>
<a className={articleStyles.card}>
<h3>{article.title} →</h3>
<p>{article.body}</p>
</a>
</Link>
)
}
export default ArticleItem
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.