shzawa / nextjs-blog-from-scratch Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://tkzawa.vercel.app/
Home Page: https://tkzawa.vercel.app/
TOPページ
折り畳めるようにした cacheで記憶
とりあえずTwitterだけ
/tags/[tag].tsxのgetStaticProps
で記事が1件もヒットしなかった場合、
if (!posts.length) {
return {
notFound: true
}
}
でエラーハンドリングをしているが、この状態だと pages/404.tsx が描画されてしまう。
npm run dev
実行後 http://localhost:3000 にアクセスすると以下のようなエラー
→ npm run dev
> [email protected] dev /Users/ozawa_shotaro/sandbox/nextjs-blog
> next dev
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info - Using webpack 4. Reason: custom webpack configuration in next.config.js https://nextjs.org/docs/messages/webpack5
event - compiled successfully
event - build page: /
wait - compiling...
event - compiled successfully
Warning: TagsLayout: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)
at TagsLayout (webpack-internal:///./components/layout.tsx:132:20)
at li
at ul
at section
at main
at div
at Container (webpack-internal:///./components/layout.tsx:24:19)
at HomeLayout (webpack-internal:///./components/layout.tsx:59:20)
at HomePage (webpack-internal:///./pages/index.tsx:34:18)
at MyApp (webpack-internal:///./pages/_app.tsx:24:15)
at AppContainer (/Users/ozawa_shotaro/sandbox/nextjs-blog/node_modules/next/dist/next-server/server/render.js:28:950)
TagsLayout
内のli
タグのkey
が空
key
が空の時空文字を挿入 -> 効果なしファイル多くなってくるとだるいお気持ち
remark-unwrap-images 入れる
けどHTML生では嫌
なにこれ…
何もしてないのに壊れちゃった❗
正常に動いていたcommitに遡ってnpm i
し直して再現した
-> 効かなくなってるのが再現された
むしろ何故最初から入れなかったのか
存在感がデカすぎる
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.