Skip to content

Commit 5e6b231

Browse files
author
chenliangzihao
committed
fix: cloudflare deploy failed
1 parent 52a82b4 commit 5e6b231

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

migration/index.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import fs from 'fs';
22
import path from 'path';
33

4-
import urlMap from './url-map.json' with { type: 'json' };
4+
// Read and parse JSON file using fs instead of 'with' syntax for Node.js 18 compatibility
5+
const urlMap = JSON.parse(fs.readFileSync(new URL('./url-map.json', import.meta.url), 'utf8'));
56

67
function normalizeUrl(url) {
78
return url.startsWith('/') ? url : `/${url}`;

0 commit comments

Comments
 (0)