Skip to content

Commit ca98b16

Browse files
committed
fix build production
1 parent 7b4944e commit ca98b16

File tree

4 files changed

+95
-19
lines changed

4 files changed

+95
-19
lines changed

next.config.mjs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,17 @@ const withMDX = nextMDX({
7777
trust: true,
7878
throwOnError: false,
7979
errorColor: '#cc0000',
80+
output: 'html',
81+
fleqn: false,
82+
leqno: false,
8083
macros: {
8184
"\\RR": "\\mathbb{R}",
8285
"\\NN": "\\mathbb{N}",
8386
},
8487
// Allow Unicode text in math mode
8588
unicodeTextInMathMode: true,
89+
// Set globalGroup to true to avoid character metric issues
90+
globalGroup: true,
8691
},
8792
],
8893
[
@@ -156,6 +161,21 @@ export default withMDX({
156161
NEXT_PUBLIC_UPLOAD_API_ENDPOINT: process.env.NEXT_PUBLIC_UPLOAD_API_ENDPOINT,
157162
NEXT_PUBLIC_UPLOAD_VIDEO_API_ENDPOINT: process.env.NEXT_PUBLIC_UPLOAD_VIDEO_API_ENDPOINT,
158163
},
164+
// Webpack configuration to suppress KaTeX warnings
165+
webpack: (config, { isServer }) => {
166+
if (isServer) {
167+
// Suppress KaTeX character metrics warnings during build
168+
const originalStderrWrite = process.stderr.write
169+
process.stderr.write = function(chunk, ...args) {
170+
const str = chunk.toString()
171+
if (str.includes('No character metrics') && str.includes('Main-Regular')) {
172+
return true // suppress these warnings
173+
}
174+
return originalStderrWrite.call(this, chunk, ...args)
175+
}
176+
}
177+
return config
178+
},
159179
// images: {
160180
// remotePatterns: [
161181
// {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"scripts": {
55
"dev": "next dev",
66
"prettier": "prettier --write \"**/*.{js, jsx}\"",
7-
"build": "next build",
7+
"build": "NODE_OPTIONS=\"--max-old-space-size=8192\" next build",
88
"postbuild": "next-sitemap",
99
"lint": "next lint"
1010
},
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* A rehype plugin to suppress KaTeX warnings about missing character metrics
3+
*/
4+
export function rehypeKatexSuppressWarnings() {
5+
return (tree, file) => {
6+
// This needs to be done at the process level
7+
if (typeof process !== 'undefined' && process.stderr && process.stderr.write) {
8+
const originalWrite = process.stderr.write
9+
process.stderr.write = function(chunk, ...args) {
10+
const str = chunk.toString()
11+
if (str.includes('No character metrics') ||
12+
str.includes('in style \'Main-Regular\' and mode \'text\'')) {
13+
// Suppress these warnings by not writing them
14+
return true
15+
}
16+
return originalWrite.call(this, chunk, ...args)
17+
}
18+
}
19+
20+
return tree
21+
}
22+
}

public/sitemap-0.xml

Lines changed: 52 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,55 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
3-
<url><loc>https://surveywithcode.github.io/hierarchy</loc><lastmod>2025-08-08T22:58:42.073Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
4-
<url><loc>https://surveywithcode.github.io/ttsflow</loc><lastmod>2025-08-08T22:58:42.074Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
5-
<url><loc>https://surveywithcode.github.io/topic</loc><lastmod>2025-08-08T22:58:42.074Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
6-
<url><loc>https://surveywithcode.github.io</loc><lastmod>2025-08-08T22:58:42.074Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
7-
<url><loc>https://surveywithcode.github.io/about</loc><lastmod>2025-08-08T22:58:42.074Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
8-
<url><loc>https://surveywithcode.github.io/indentedtree</loc><lastmod>2025-08-08T22:58:42.074Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
9-
<url><loc>https://surveywithcode.github.io/markdown</loc><lastmod>2025-08-08T22:58:42.074Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
10-
<url><loc>https://surveywithcode.github.io/leaderboard</loc><lastmod>2025-08-08T22:58:42.074Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
11-
<url><loc>https://surveywithcode.github.io/trans</loc><lastmod>2025-08-08T22:58:42.074Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
12-
<url><loc>https://surveywithcode.github.io/rating</loc><lastmod>2025-08-08T22:58:42.074Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
13-
<url><loc>https://surveywithcode.github.io/getting-started</loc><lastmod>2025-08-08T22:58:42.074Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
14-
<url><loc>https://surveywithcode.github.io/sample</loc><lastmod>2025-08-08T22:58:42.074Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
15-
<url><loc>https://surveywithcode.github.io/graph</loc><lastmod>2025-08-08T22:58:42.074Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
16-
<url><loc>https://surveywithcode.github.io/question</loc><lastmod>2025-08-08T22:58:42.074Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
17-
<url><loc>https://surveywithcode.github.io/taxonomy</loc><lastmod>2025-08-08T22:58:42.074Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
18-
<url><loc>https://surveywithcode.github.io/error</loc><lastmod>2025-08-08T22:58:42.074Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
19-
<url><loc>https://surveywithcode.github.io/result</loc><lastmod>2025-08-08T22:58:42.074Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
20-
<url><loc>https://surveywithcode.github.io/contact</loc><lastmod>2025-08-08T22:58:42.074Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
3+
<url><loc>https://surveywithcode.github.io/sample</loc><lastmod>2025-08-11T05:44:29.053Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
4+
<url><loc>https://surveywithcode.github.io/test-responsive</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
5+
<url><loc>https://surveywithcode.github.io/ttsflow</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
6+
<url><loc>https://surveywithcode.github.io/error</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
7+
<url><loc>https://surveywithcode.github.io/trans</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
8+
<url><loc>https://surveywithcode.github.io</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
9+
<url><loc>https://surveywithcode.github.io/question</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
10+
<url><loc>https://surveywithcode.github.io/about</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
11+
<url><loc>https://surveywithcode.github.io/topic</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
12+
<url><loc>https://surveywithcode.github.io/hierarchy</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
13+
<url><loc>https://surveywithcode.github.io/contact</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
14+
<url><loc>https://surveywithcode.github.io/graph</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
15+
<url><loc>https://surveywithcode.github.io/indentedtree</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
16+
<url><loc>https://surveywithcode.github.io/getting-started</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
17+
<url><loc>https://surveywithcode.github.io/china</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
18+
<url><loc>https://surveywithcode.github.io/taxonomy</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
19+
<url><loc>https://surveywithcode.github.io/french</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
20+
<url><loc>https://surveywithcode.github.io/dutch</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
21+
<url><loc>https://surveywithcode.github.io/attention</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
22+
<url><loc>https://surveywithcode.github.io/chinese</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
23+
<url><loc>https://surveywithcode.github.io/english</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
24+
<url><loc>https://surveywithcode.github.io/homebrew</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
25+
<url><loc>https://surveywithcode.github.io/campuchia</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
26+
<url><loc>https://surveywithcode.github.io/czech</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
27+
<url><loc>https://surveywithcode.github.io/markdown</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
28+
<url><loc>https://surveywithcode.github.io/hindi</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
29+
<url><loc>https://surveywithcode.github.io/german</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
30+
<url><loc>https://surveywithcode.github.io/leaderboard</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
31+
<url><loc>https://surveywithcode.github.io/italian</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
32+
<url><loc>https://surveywithcode.github.io/rating</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
33+
<url><loc>https://surveywithcode.github.io/result</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
34+
<url><loc>https://surveywithcode.github.io/hungarian</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
35+
<url><loc>https://surveywithcode.github.io/hongkong</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
36+
<url><loc>https://surveywithcode.github.io/korean</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
37+
<url><loc>https://surveywithcode.github.io/japan</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
38+
<url><loc>https://surveywithcode.github.io/thailand</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
39+
<url><loc>https://surveywithcode.github.io/norwegian</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
40+
<url><loc>https://surveywithcode.github.io/spain</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
41+
<url><loc>https://surveywithcode.github.io/laos</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
42+
<url><loc>https://surveywithcode.github.io/greek</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
43+
<url><loc>https://surveywithcode.github.io/philipino</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
44+
<url><loc>https://surveywithcode.github.io/morocco</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
45+
<url><loc>https://surveywithcode.github.io/taiwan</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
46+
<url><loc>https://surveywithcode.github.io/portuguese</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
47+
<url><loc>https://surveywithcode.github.io/swedish</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
48+
<url><loc>https://surveywithcode.github.io/arabic</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
49+
<url><loc>https://surveywithcode.github.io/transformer</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
50+
<url><loc>https://surveywithcode.github.io/turkish</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
51+
<url><loc>https://surveywithcode.github.io/russian</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
52+
<url><loc>https://surveywithcode.github.io/vietnam</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
53+
<url><loc>https://surveywithcode.github.io/polish</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
54+
<url><loc>https://surveywithcode.github.io/vietnamese</loc><lastmod>2025-08-11T05:44:29.054Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
2155
</urlset>

0 commit comments

Comments
 (0)