Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

build: do not fail build for a non-fatal error (#6017)

Peng Xiao65b32156a866
diff --git a/packages/frontend/electron/scripts/generate-assets.ts b/packages/frontend/electron/scripts/generate-assets.ts
index 7d0fdefb7b..6f1347eb2d 100755
--- a/packages/frontend/electron/scripts/generate-assets.ts
+++ b/packages/frontend/electron/scripts/generate-assets.ts
@@ -68,7 +68,13 @@ if (!process.env.SKIP_WEB_BUILD) {
content = content.replace(/# sourceMappingURL=(.*)\.map/g, (_, p1) => {
return `# sourceMappingURL=assets://./${dir}/${p1}.map`;
});
- await fs.writeFile(fullpath, content);
+ try {
+ await fs.writeFile(fullpath, content);
+ console.log('amended sourceMappingURL for', fullpath);
+ } catch (e) {
+ // do not crash the build
+ console.error('error writing file', fullpath, e);
+ }
});
});