mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Fix error-codes not updating correctly (#10348)
* Fix error-codes not updating correctly * Revert changes to codes.json
This commit is contained in:
committed by
Dan Abramov
parent
c5d1558a5b
commit
73217a74a0
@@ -40,10 +40,15 @@ module.exports = function(opts) {
|
||||
var errorMapFilePath = opts.errorMapFilePath;
|
||||
var existingErrorMap;
|
||||
try {
|
||||
existingErrorMap = require(path.join(
|
||||
__dirname,
|
||||
path.basename(errorMapFilePath)
|
||||
));
|
||||
// Using `fs.readFileSync` instead of `require` here, because `require()`
|
||||
// calls are cached, and the cache map is not properly invalidated after
|
||||
// file changes.
|
||||
existingErrorMap = JSON.parse(
|
||||
fs.readFileSync(
|
||||
path.join(__dirname, path.basename(errorMapFilePath)),
|
||||
'utf8'
|
||||
)
|
||||
);
|
||||
} catch (e) {
|
||||
existingErrorMap = {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user