We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
createReadStream
1 parent d8cc141 commit 812078bCopy full SHA for 812078b
1 file changed
apps/site/next-data/generators/blogData.mjs
@@ -68,6 +68,16 @@ const generateBlogData = async () => {
68
const rawFrontmatter = [];
69
70
filenames.forEach(filename => {
71
+ if (globalThis.navigator?.userAgent === 'Cloudflare-Workers') {
72
+ // createReadStream doesn't work in the workers runtime so let's skip this for now
73
+ // (note: the logic here does work at build time though)
74
+
75
+ console.log(`\x1b[31mRUNNING generateBlogData inside workerd, we should avoid this if possible!\x1b[0m`);
76
77
+ resolve({ categories: [], posts: [] });
78
+ return;
79
+ }
80
81
// We create a stream for reading a file instead of reading the files
82
const _stream = createReadStream(join(blogPath, filename));
83
0 commit comments