You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
○ (Static) automatically rendered as static HTML (uses no initial props)
● (SSG) automatically generated as static HTML + JSON (uses getStaticProps)
Error: No more than 12 Serverless Functions can be added to a Deployment on the Hobby plan. Create a team (Pro plan) to deploy more. Learn More: https://vercel.link/function-count-limit
next/image
SEO
next-seo images 参数是一个数组,大部分情况都是使用最后一张作为封面。如果需要特定图片作为封面可只设置一张。
PWA
Layout
Vercel
λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
○ (Static) automatically rendered as static HTML (uses no initial props)
● (SSG) automatically generated as static HTML + JSON (uses getStaticProps)
https://cant-xt.vercel.app/docs/folder-structure/next 一些 serverless limit 规则
Header
SharedArrayBuffer
嵌入 iframe 需要支持
SharedArrayBuffer
, 父级需要定义 header. 一些相关记录#111
#112
#113
iframe 源也开启了会被拒绝链接
页面
第一次进入页面会
SSG
渲染页面。但是只在 /game 页面下定义了 header 参数,故首页无参数。CSR
https://juejin.cn/post/6925308376976982029/_next/static/chunks/pages/game/%5Bid%5D.js
Content-Type: application/javascript; charset=UTF-8
/_next/data/development/en-US/game/177.json?id=177
Content-Type: application/json
getStaticProps
https://nextjs.org/docs/api-reference/data-fetching/get-static-props
getStaticProps context locale 参数,默认定义为
locale?: string
。大概看了一下源码的定义https://github.com/vercel/next.js/blob/39302141b5ea3a1e9a55af906129a44675337cf9/packages/next/export/index.ts#L375
猜测应该是这里处理的。因为我们定义了 i18n config,locale 使用了
i18n?.defaultLocale
配置。然后会根据 cookie 或 url 路径处理好当前语言环境。可能返回
en-US | zh-CN
可以修改类型消除错误
...(await serverSideTranslations(ctx.locale as string, ['common'])),
webassembly
vercel/next.js#25852
Jest
Production Branch
切换生产分支
The text was updated successfully, but these errors were encountered: