Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions apps/ssr-tests-v9/src/utils/visitPage.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Browser } from 'puppeteer';
import { visitUrl } from '@fluentui/scripts-puppeteer';
import { PROVIDER_ID } from './constants';
import { version } from 'react';
Comment thread
petdud marked this conversation as resolved.
Outdated

class RenderError extends Error {
public name = 'RangeError';
Expand All @@ -14,9 +15,21 @@ export async function visitPage(browser: Browser, url: string) {

page.on('console', message => {
if (message.type() === 'error') {
const messageContent = message.text();

// Ignoring 'aria-description' warning from react 17 as it's a valid prop
// https://github.com/facebook/react/issues/21035
if (
messageContent.startsWith('Warning: Invalid aria prop %s on <%s> tag.') &&
Comment thread
petdud marked this conversation as resolved.
Outdated
messageContent.includes('`aria-description`') &&
version.startsWith('17')
Comment thread
petdud marked this conversation as resolved.
Outdated
) {
return;
}

// Ignoring network errors as we have an interceptor that prevents loading everything except our JS bundle
if (!message.text().includes('net::ERR_FAILED')) {
error = new RenderError(message.text());
if (!messageContent.includes('net::ERR_FAILED')) {
error = new RenderError(messageContent);
}
}
});
Expand Down