Skip to content

Commit 527f51a

Browse files
committed
Ignore noisy errors for now
1 parent 0b5e97e commit 527f51a

File tree

1 file changed

+70
-5
lines changed

1 file changed

+70
-5
lines changed

test/e2e/app-dir/errors/index.test.ts

Lines changed: 70 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,20 @@ describe('app-dir - errors', () => {
1818
const browser = await next.browser('/client-component', {
1919
beforePageLoad: (page) => {
2020
page.on('pageerror', (error: unknown) => {
21-
pageErrors.push(error)
21+
if (
22+
error !== null &&
23+
typeof error === 'object' &&
24+
'message' in error &&
25+
typeof error.message === 'string' &&
26+
error.message.includes(
27+
"Cannot read properties of null (reading 'removeChild')"
28+
)
29+
) {
30+
// unactionable and just noise until we fix https://github.com/facebook/react/pull/33531
31+
// TODO: Don't ignore this error once the underlying issue is fixed.
32+
} else {
33+
pageErrors.push(error)
34+
}
2235
})
2336
},
2437
})
@@ -44,7 +57,20 @@ describe('app-dir - errors', () => {
4457
const browser = await next.browser('/server-component', {
4558
beforePageLoad: (page) => {
4659
page.on('pageerror', (error: unknown) => {
47-
pageErrors.push(error)
60+
if (
61+
error !== null &&
62+
typeof error === 'object' &&
63+
'message' in error &&
64+
typeof error.message === 'string' &&
65+
error.message.includes(
66+
"Cannot read properties of null (reading 'removeChild')"
67+
)
68+
) {
69+
// unactionable and just noise until we fix https://github.com/facebook/react/pull/33531
70+
// TODO: Don't ignore this error once the underlying issue is fixed.
71+
} else {
72+
pageErrors.push(error)
73+
}
4874
})
4975
},
5076
})
@@ -167,7 +193,20 @@ describe('app-dir - errors', () => {
167193
const browser = await next.browser('/global-error-boundary/client', {
168194
beforePageLoad: (page) => {
169195
page.on('pageerror', (error: unknown) => {
170-
pageErrors.push(error)
196+
if (
197+
error !== null &&
198+
typeof error === 'object' &&
199+
'message' in error &&
200+
typeof error.message === 'string' &&
201+
error.message.includes(
202+
"Cannot read properties of null (reading 'removeChild')"
203+
)
204+
) {
205+
// unactionable and just noise until we fix https://github.com/facebook/react/pull/33531
206+
// TODO: Don't ignore this error once the underlying issue is fixed.
207+
} else {
208+
pageErrors.push(error)
209+
}
171210
})
172211
},
173212
})
@@ -207,7 +246,20 @@ describe('app-dir - errors', () => {
207246
const browser = await next.browser('/global-error-boundary/server', {
208247
beforePageLoad: (page) => {
209248
page.on('pageerror', (error: unknown) => {
210-
pageErrors.push(error)
249+
if (
250+
error !== null &&
251+
typeof error === 'object' &&
252+
'message' in error &&
253+
typeof error.message === 'string' &&
254+
error.message.includes(
255+
"Cannot read properties of null (reading 'removeChild')"
256+
)
257+
) {
258+
// unactionable and just noise until we fix https://github.com/facebook/react/pull/33531
259+
// TODO: Don't ignore this error once the underlying issue is fixed.
260+
} else {
261+
pageErrors.push(error)
262+
}
211263
})
212264
},
213265
})
@@ -280,7 +332,20 @@ describe('app-dir - errors', () => {
280332
await next.browser('/ssr-error-client-component', {
281333
beforePageLoad: (page) => {
282334
page.on('pageerror', (error: unknown) => {
283-
pageErrors.push(error)
335+
if (
336+
error !== null &&
337+
typeof error === 'object' &&
338+
'message' in error &&
339+
typeof error.message === 'string' &&
340+
error.message.includes(
341+
"Cannot read properties of null (reading 'removeChild')"
342+
)
343+
) {
344+
// unactionable and just noise until we fix https://github.com/facebook/react/pull/33531
345+
// TODO: Don't ignore this error once the underlying issue is fixed.
346+
} else {
347+
pageErrors.push(error)
348+
}
284349
})
285350
},
286351
})

0 commit comments

Comments
 (0)