Skip to content
This repository was archived by the owner on Sep 29, 2025. It is now read-only.

Commit 7933c1a

Browse files
Ignore invalid favicon.ico.rsc nodejs functions being generated by the Vercel CLI (since 46.1.0) (#983)
1 parent b448f90 commit 7933c1a

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

.changeset/twelve-avocados-sip.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@cloudflare/next-on-pages': patch
3+
---
4+
5+
Ignore invalid favicon.ico.rsc nodejs functions being generated by the Vercel CLI (since 46.1.0)

packages/next-on-pages/src/buildApplication/processVercelFunctions/invalidFunctions.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ export async function checkInvalidFunctions(
4343

4444
await tryToFixI18nFunctions(collectedFunctions, opts);
4545

46+
await fixFaviconInvalidRSCFuncFunction(collectedFunctions);
47+
4648
await tryToFixInvalidFuncsWithValidIndexAlternative(collectedFunctions);
4749
await tryToFixInvalidDynamicISRFuncs(collectedFunctions);
4850

@@ -138,6 +140,28 @@ async function fixActionInvalidFuncFunctions({
138140
}
139141
}
140142

143+
/**
144+
* Since 46.1.0 the Vercel CLI generates incorrect favicon RSC functions,
145+
* they are safe to ignore without any downside, this functions makes sure
146+
* that such favicon RSC functions do get ignored
147+
*
148+
* @param collectedFunctions Collected functions from the Vercel build output.
149+
*/
150+
async function fixFaviconInvalidRSCFuncFunction({
151+
invalidFunctions,
152+
ignoredFunctions,
153+
}: CollectedFunctions): Promise<void> {
154+
for (const [fullPath, fnInfo] of invalidFunctions.entries()) {
155+
if (fnInfo.relativePath === '/favicon.ico.rsc.func') {
156+
ignoredFunctions.set(fullPath, {
157+
reason: 'invalid favicon.ico.rsc.func functions are ignored',
158+
...fnInfo,
159+
});
160+
invalidFunctions.delete(fullPath);
161+
}
162+
}
163+
}
164+
141165
/**
142166
* In the App router, error boundaries are implemented as client components
143167
* (see: https://nextjs.org/docs/app/api-reference/file-conventions/error), meaning that they

0 commit comments

Comments
 (0)