Open
Conversation
- Fix undefined pageCoverThumbnail serialization error in getStaticProps - Fix undefined href error in Link components - Change ?? to || operator for image URL handling in getPageProperties - Add validation for image and href fields in cleanPages function - Add category mapper utility for Chinese to English conversion - Update blog configuration with author information - Add Claude Code documentation (CLAUDE.md, AGENTS.md) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add Chinese/English dual database configuration example - Document URL access patterns for different languages - Provide clear setup instructions for multi-language support
Features: - Add LanguageSwitcher component with dropdown menu - Support multiple languages with flag emojis - Auto-detect available locales from router - Smooth transitions and hover effects - Dark mode support - Integrated into heo theme header - Only shows when multiple languages are configured Usage: - Click flag icon to open language menu - Select language to switch - Current language is highlighted with checkmark
Features: - Configure Algolia full-text search integration - Add detailed configuration comments in .env.example - Support free tier: 10,000 searches/month, 10,000 records - Configure App ID, Admin Key, Search-only Key, and Index name Configuration: - NEXT_PUBLIC_ALGOLIA_APP_ID: Application ID - ALGOLIA_ADMIN_APP_KEY: Admin key (backend only, not exposed) - NEXT_PUBLIC_ALGOLIA_SEARCH_ONLY_APP_KEY: Client search key - NEXT_PUBLIC_ALGOLIA_INDEX: Database index name Algolia Dashboard: https://dashboard.algolia.com/account/api-keys/
- Add CHATBASE_ID environment variable documentation to .env.example - Configure Chatbase chatbot (ID: 5yPXdJr9Pn0D2N5agPLRe) - Chatbot widget will appear in bottom right corner of website - Free tier: 20 messages/month, 400,000 characters/bot
- Add useGlobal hook to get current locale - Add translations for zh-CN, en, and en-US - Replace hardcoded Chinese text with locale-specific translations - Contact Channel / Communication Channel now displays in appropriate language
- Add i18n translations for banner titles and categories - Support for zh-CN, en, and en-US locales - Dynamic text switching based on current locale - Update TodayCard subtitle and title with translations 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
@kenchikuliu is attempting to deploy a commit to the tangly1024's projects Team on Vercel. A member of the Team first needs to authorize it. |
- Fix double-nested value structure in Notion API response (block, collection, rawMetadata) - Add defensive null checks in getAllPageIds to prevent crashes - Improve categoryOptions and tagOptions serialization safety - Add timeout and retry configuration for Notion API requests - Update CLAUDE.md with comprehensive project documentation - Add debugging logs for better troubleshooting This fixes the issue where Notion blog data was not loading due to incorrect data structure parsing. All 109 published posts now load correctly.
## 问题描述
Vercel部署在生成/zh-CN/links静态页面时失败,错误:
```
TypeError: Cannot read properties of undefined (reading 'replaceAll')
at uuidToId (notion-utils/build/index.js:533:31)
at Block (react-notion-x/build/index.js:2579:66)
```
## 根本原因
在处理Notion数据时,某些页面的block数据不存在或ID为undefined,但代码仍尝试处理这些无效页面:
- `block[id]`返回undefined时,代码继续提取value
- 无效的block ID最终传递给react-notion-x渲染
- 渲染时调用`uuidToId(undefined)`导致崩溃
## 解决方案
在lib/db/getSiteData.js的数据处理循环中添加防御性检查:
1. 跳过ID为undefined的页面
2. 跳过block不存在的页面(`!block[id]`)
3. 跳过value或properties不完整的页面
## 修改文件
- lib/db/getSiteData.js
- 在处理pageIds循环中添加3层防御性验证
- 添加警告日志记录跳过的无效页面
- 确保只有完整有效的页面数据进入渲染流程
## 测试结果
✅ 本地构建成功:npm run build
✅ 所有70个静态页面成功生成
✅ 无uuidToId错误
## 影响范围
- 提高数据处理的健壮性
- 避免因个别无效页面导致整体构建失败
- 不影响正常页面的渲染和功能
相关issue: Vercel deployment ERROR on /zh-CN/links page
## 问题深入分析 之前的修复(commit 4c21689)只解决了数据获取阶段的问题,但Vercel部署仍然失败。 根本原因是:/zh-CN/links页面的blockMap本身包含无效block(blockId存在但value为null/undefined), 这些无效block在渲染阶段被传递给react-notion-x的Block组件,导致uuidToId(undefined)崩溃。 ## 问题链条 1. Notion API返回的某些页面blockMap包含无效block 2. getSiteData.js的修复只跳过了无效的page数据,但未清理blockMap内的无效block 3. getPostBlocks.js的convertNotionBlocksToPost处理blockMap时未过滤无效block 4. 无效block传递给NotionPage组件 → react-notion-x渲染 → uuidToId(undefined)崩溃 ## 解决方案 在lib/notion/getPostBlocks.js的convertNotionBlocksToPost函数中: - 在遍历blockMap时添加防御性检查 - 移除blockId为falsy或block.value不存在的无效block - 添加警告日志记录被移除的无效block - 确保传递给渲染组件的blockMap只包含有效数据 ## 修改文件 - lib/notion/getPostBlocks.js - convertNotionBlocksToPost函数添加无效block检查 - 在slice检查之前过滤无效数据 - 保证渲染阶段不会遇到undefined的blockId ## 测试结果 ✅ 本地构建成功:npm run build ✅ 所有70个静态页面成功生成 ✅ 无uuidToId错误 ✅ /zh-CN/links页面正常生成 ## 影响范围 - 修复Vercel部署在/zh-CN/links页面的渲染崩溃 - 提高blockMap处理的健壮性 - 防止任何包含无效block的页面导致渲染失败 - 不影响正常block的渲染 相关commits: 4c21689 (数据获取阶段修复), 2c91b45 (Notion API双嵌套修复)
问题根因: - Notion API返回的block对象键名与请求的pageId不一致 - block中实际键: 12700092-b977-817c-9fe7-e28e92e9b996 - 请求的pageId: 2a2f7026-d667-4bd1-9c5a-ec3c94bfd453 修复方案: - 使用Object.keys(block)[0]获取实际存在的键 - 不再假设block[pageId]一定存在
测试ID: 02ab3b8678004aa69e9e415905ef32a5,en:7c1d570661754c8fbc568e00a01fd70e 目的: 验证默认模板数据库是否可正常访问
根本问题: - rawMetadata.type是text(页面类型) - 但页面包含inline database在pageRecordMap.collection中 修复方案: 1. 移除type检查(不再要求collection_view_page类型) 2. 直接从pageRecordMap.collection获取collectionId 3. 检查collection.schema是否存在来验证有效性 这样支持: - collection_view_page(独立database页面) - text页面 + inline database(内嵌database)
问题已彻底解决,恢复正常的环境变量读取逻辑
将默认主题从simple改为heo
添加BLOG_FAVICON配置项支持,自动读取Notion数据库的icon作为网站favicon
Generated via Jimeng AI for: attention, jilu, chuhaihegui, deepseekai, deepseekr1local, deepseekr1api Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Match the English tag taxonomy used in the database. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- tail-promo.png: Brand promotional image for article footers - manus-hero1.png: AI agent illustration for Manus article - manus-hero2.png: Open-source AI agent comparison illustration Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 将默认主题从 heo 改为 medium(更适合技术博客) - 添加自定义 CSS 样式优化: - 增加段落间距(1.5rem)和行高(1.8) - 优化标题层级和间距 - 美化代码块样式(圆角、边框、内边距) - 改善行内代码显示 - 优化列表、引用块、图片样式 - 添加响应式设计支持 - 提升整体阅读体验
改善博客排版:更换为 medium 主题并添加自定义样式
- 中文数据库: 2a2f7026d6674bd19c5aec3c94bfd453 - 英文数据库: 13e00092b9778002a3e2d5278bab3cd9 - heo 主题已内置 LanguageSwitcher 组件
…ial card now support zh-CN and en-US
- convertInnerUrl: add a.notion-page-link selector to fix page link routing - getPostBlocks: add sanitizeBlockUrls to handle malformed image URLs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
已知问题
解决方案
.env.local迁移到package.jsonpackage.json读取版本号改动收益
package.json读取具体改动
blog.config.js测试确认