You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// We try to be as specific as possible to avoid patching the wrong thing here
5
-
// It seems that there is a bug in the worker runtime. When the AbortController is created outside of the request context it throws an error (not sure if it's expected or not) except in this case. https://github.com/cloudflare/workerd/issues/3657
6
-
// It fails while requiring the `app-page.runtime.prod.js` file, but instead of throwing an error, it just return an empty object for the `require('app-page.runtime.prod.js')` call which makes every request to an app router page fail.
7
-
// If it's a bug in workerd and it's not expected to throw an error, we can remove this patch.
8
-
exportconstabortControllerRule=`
9
-
rule:
10
-
all:
11
-
- kind: lexical_declaration
12
-
pattern: let $VAR = new AbortController
13
-
- precedes:
14
-
kind: function_declaration
15
-
stopBy: end
16
-
has:
17
-
kind: statement_block
18
-
has:
19
-
kind: try_statement
20
-
has:
21
-
kind: catch_clause
22
-
has:
23
-
kind: statement_block
24
-
has:
25
-
kind: return_statement
26
-
all:
27
-
- has:
28
-
stopBy: end
29
-
kind: member_expression
30
-
pattern: $VAR.signal.aborted
31
-
- has:
32
-
stopBy: end
33
-
kind: call_expression
34
-
regex: console.error\\("Failed to fetch RSC payload for
35
-
36
-
fix:
37
-
'let $VAR = {signal:{aborted: false}};'
38
-
`;
39
-
40
4
// This rule is used instead of defining `process.env.NEXT_MINIMAL` in the `esbuild config.
41
5
// Do we want to entirely replace these functions to reduce the bundle size?
42
6
// In next `renderHTML` is used as a fallback in case of errors, but in minimal mode it just throws the error and the responsibility of handling it is on the infra.
0 commit comments