Skip to content

Commit db76fba

Browse files
committed
Add unreleased error messages to map
1 parent cbcdd7a commit db76fba

File tree

12 files changed

+36
-11
lines changed

12 files changed

+36
-11
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
"linc": "node ./scripts/tasks/linc.js",
9898
"lint": "node ./scripts/tasks/eslint.js",
9999
"lint-build": "node ./scripts/rollup/validate/index.js",
100+
"extract-errors": "yarn build --type=dev --extract-errors",
100101
"postinstall": "node node_modules/fbjs-scripts/node/check-dev-engines.js package.json && node ./scripts/flow/createFlowConfigs.js",
101102
"debug-test": "cross-env NODE_ENV=development node --inspect-brk node_modules/.bin/jest --config ./scripts/jest/config.source.js --runInBand",
102103
"test": "cross-env NODE_ENV=development jest --config ./scripts/jest/config.source.js",

packages/react-native-renderer/src/__mocks__/react-native/Libraries/ReactPrivate/InitializeNativeFabricUIManager.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8+
/* eslint-disable react-internal/warning-and-invariant-args */
9+
810
'use strict';
911

1012
// Mock of the Native Hooks

packages/react-native-renderer/src/__mocks__/react-native/Libraries/ReactPrivate/ReactNativeViewConfigRegistry.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
* @flow strict-local
88
*/
99

10+
/* eslint-disable react-internal/warning-and-invariant-args */
11+
1012
'use strict';
1113

1214
import type {

packages/react-native-renderer/src/__mocks__/react-native/Libraries/ReactPrivate/UIManager.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8+
/* eslint-disable react-internal/warning-and-invariant-args */
9+
810
'use strict';
911

1012
// Mock of the Native Hooks

packages/react-reconciler/src/ReactFiberHostConfig.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
* @flow
88
*/
99

10+
/* eslint-disable react-internal/warning-and-invariant-args */
11+
1012
import invariant from 'shared/invariant';
1113

1214
// We expect that our Rollup, Jest, and Flow configurations

packages/react-stream/src/ReactFizzFormatConfig.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
* @flow
88
*/
99

10+
/* eslint-disable react-internal/warning-and-invariant-args */
11+
1012
import invariant from 'shared/invariant';
1113

1214
// We expect that our Rollup, Jest, and Flow configurations

packages/react-stream/src/ReactFizzHostConfig.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
* @flow
88
*/
99

10+
/* eslint-disable react-internal/warning-and-invariant-args */
11+
1012
import invariant from 'shared/invariant';
1113

1214
// We expect that our Rollup, Jest, and Flow configurations

scripts/error-codes/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ provide a better debugging support in production. Check out the blog post
99
the file will never be changed/removed.
1010
- [`extract-errors.js`](https://github.com/facebook/react/blob/master/scripts/error-codes/extract-errors.js)
1111
is an node script that traverses our codebase and updates `codes.json`. You
12-
can test it by running `yarn build -- --extract-errors`, but you should only
13-
commit changes to this file when running a release. (The release tool will
14-
perform this step automatically.)
12+
can test it by running `yarn extract-errors`.
1513
- [`transform-error-messages`](https://github.com/facebook/react/blob/master/scripts/error-codes/transform-error-messages)
1614
is a Babel pass that rewrites error messages to IDs for a production
1715
(minified) build.

scripts/error-codes/codes.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@
222222
"220": "Container does not support insertBefore operation",
223223
"221": "Tried to register two views with the same name %s",
224224
"222": "View config not found for name %s",
225-
"223": "Trying to release an event instance into a pool of a different type.",
226225
"224": "Can't read from currently-mounting component. This error is likely caused by a bug in React. Please file an issue.",
227226
"225": "Unexpected object passed to ReactTestInstance constructor (tag: %s). This is probably a bug in React.",
228227
"226": "Unsupported component type %s in test renderer. This is probably a bug in React.",
@@ -321,5 +320,18 @@
321320
"319": "A dehydrated suspense boundary must commit before trying to render. This is probably a bug in React.",
322321
"320": "Expected ReactFiberErrorDialog.showErrorDialog to be a function.",
323322
"321": "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.",
324-
"322": "forwardRef requires a render function but was given %s."
323+
"322": "forwardRef requires a render function but was given %s.",
324+
"323": "React has blocked a javascript: URL as a security precaution.%s",
325+
"324": "An event responder context was used outside of an event cycle. Use context.setTimeout() to use asynchronous responder context outside of event cycle .",
326+
"325": "addRootEventTypes() found a duplicate root event type of \"%s\". This might be because the event type exists in the event responder \"rootEventTypes\" array or because of a previous addRootEventTypes() using this root event type.",
327+
"326": "Expected a valid priority level",
328+
"327": "Should not already be working.",
329+
"328": "Should have a work-in-progress.",
330+
"329": "Unknown root exit status.",
331+
"330": "Should be working on an effect.",
332+
"331": "Cannot flush passive effects while already rendering.",
333+
"332": "Unknown priority level.",
334+
"333": "This should have a parent host component initialized. This error is likely caused by a bug in React. Please file an issue.",
335+
"334": "accumulate(...): Accumulated items must not be null or undefined.",
336+
"335": "ReactDOMServer does not yet support the event API."
325337
}

scripts/eslint-rules/__tests__/warning-and-invariant-args-test.internal.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ ruleTester.run('eslint-rules/warning-and-invariant-args', rule, {
104104
{
105105
message:
106106
'Error message does not have a corresponding production error code.\n\n' +
107-
'Run `yarn build --extract-errors` to add the message to error code map, ' +
108-
'so it can be stripped from the production builds. Alternatively, if ' +
109-
"you're updating an existing error message, you can modify " +
110-
'`scripts/error-codes/codes.json` directly.',
107+
'Run `yarn extract-errors` to add the message to error code map, ' +
108+
'so it can be stripped from the production builds. ' +
109+
"Alternatively, if you're updating an existing error message, " +
110+
'you can modify `scripts/error-codes/codes.json` directly.',
111111
},
112112
],
113113
},

0 commit comments

Comments
 (0)