Skip to content

Commit 0e31c48

Browse files
committed
fix(assets): check if favicon.ico is a file
1 parent a6e0210 commit 0e31c48

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@opennextjs/aws": patch
3+
---
4+
5+
When copying over assets, check to see if favicon.ico is a file. In some cases favicon.ico is a folder that can contain a route handler.

packages/open-next/src/build/createAssets.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function createStaticAssets(options: buildHelper.BuildOptions) {
4444

4545
const faviconPath = path.join(appPath, appSrcPath, "favicon.ico");
4646

47-
if (fs.existsSync(faviconPath)) {
47+
if (fs.existsSync(faviconPath) && fs.lstatSync(faviconPath).isFile()) {
4848
fs.copyFileSync(faviconPath, path.join(outputPath, "favicon.ico"));
4949
}
5050
}

0 commit comments

Comments
 (0)