Skip to content

Commit de927e6

Browse files
committed
Update error decoder URL
1 parent 5309f10 commit de927e6

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

packages/react-reconciler/src/ReactFiberHooks.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1865,9 +1865,9 @@ function updateSyncExternalStore<T>(
18651865
);
18661866
}
18671867

1868-
if (!isHydrating && !includesBlockingLane(root, renderLanes)) {
1869-
pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot);
1870-
}
1868+
// if (!isHydrating && !includesBlockingLane(root, renderLanes)) {
1869+
// pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot);
1870+
// }
18711871
}
18721872

18731873
return nextSnapshot;

packages/shared/__tests__/ReactError-test.internal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ describe('ReactError', () => {
4141
it('should error with minified error code', () => {
4242
expect(() => ReactDOM.render('Hi', null)).toThrowError(
4343
'Minified React error #200; visit ' +
44-
'https://reactjs.org/docs/error-decoder.html?invariant=200' +
44+
'https://react.dev/errors/200' +
4545
' for the full message or use the non-minified dev environment' +
4646
' for full errors and additional helpful warnings.',
4747
);

packages/shared/__tests__/ReactErrorProd-test.internal.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,21 @@ describe('ReactErrorProd', () => {
1919
it('should throw with the correct number of `%s`s in the URL', () => {
2020
expect(formatProdErrorMessage(124, 'foo', 'bar')).toEqual(
2121
'Minified React error #124; visit ' +
22-
'https://reactjs.org/docs/error-decoder.html?invariant=124&args[]=foo&args[]=bar' +
22+
'https://react.dev/errors/124?args[]=foo&args[]=bar' +
2323
' for the full message or use the non-minified dev environment' +
2424
' for full errors and additional helpful warnings.',
2525
);
2626

2727
expect(formatProdErrorMessage(20)).toEqual(
2828
'Minified React error #20; visit ' +
29-
'https://reactjs.org/docs/error-decoder.html?invariant=20' +
29+
'https://react.dev/errors/20' +
3030
' for the full message or use the non-minified dev environment' +
3131
' for full errors and additional helpful warnings.',
3232
);
3333

3434
expect(formatProdErrorMessage(77, '<div>', '&?bar')).toEqual(
3535
'Minified React error #77; visit ' +
36-
'https://reactjs.org/docs/error-decoder.html?invariant=77&args[]=%3Cdiv%3E&args[]=%26%3Fbar' +
36+
'https://react.dev/errors/77?args[]=%3Cdiv%3E&args[]=%26%3Fbar' +
3737
' for the full message or use the non-minified dev environment' +
3838
' for full errors and additional helpful warnings.',
3939
);

packages/shared/formatProdErrorMessage.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@
1111
// during build.
1212

1313
function formatProdErrorMessage(code) {
14-
let url = 'https://reactjs.org/docs/error-decoder.html?invariant=' + code;
15-
for (let i = 1; i < arguments.length; i++) {
16-
url += '&args[]=' + encodeURIComponent(arguments[i]);
14+
let url = 'https://react.dev/errors/' + code;
15+
if (arguments.length > 1) {
16+
url += '?args[]=' + encodeURIComponent(arguments[1]);
17+
for (let i = 2; i < arguments.length; i++) {
18+
url += '&args[]=' + encodeURIComponent(arguments[i]);
19+
}
1720
}
21+
1822
return (
1923
`Minified React error #${code}; visit ${url} for the full message or ` +
2024
'use the non-minified dev environment for full errors and additional ' +

0 commit comments

Comments
 (0)