It seems to cause an issue with recent versions of Yarn.
errors: [
{
detail: undefined,
id: '',
location: {
column: 25,
file: '../.yarn/__virtual__/micro-observables-virtual-7722fe8c8c/0/cache/micro-observables-npm-1.7.2-8e88bfdb52-15dd9eadc5.zip/node_modules/micro-observables/batchingForRea
ctDom.js',
length: 11,
line: 1,
lineText: 'const ReactDOM = require("react-dom");',
namespace: '',
suggestion: ''
},
notes: [
{
location: {
column: 33,
file: '../.pnp.cjs',
length: 343,
line: 9047,
lineText: ' "packageDependencies": [\\',
namespace: '',
suggestion: ''
},
text: `The Yarn Plug'n'Play manifest forbids importing "react-dom" here because it's not listed as a dependency of this package:`
},
{
location: null,
text: 'You can mark the path "react-dom" as external to exclude it from the bundle, which will remove this error. You can also surround this "require" call with a try/cat
ch block to handle this failure at run-time instead of bundle-time.'
}
],
pluginName: '',
text: 'Could not resolve "react-dom"'
}
]
Currenty batchingForReactDom.js references
react-domeven throughreact-domis not referenced in the projectpackage.jsonfile.It seems to cause an issue with recent versions of Yarn.
Would it be possible to
react-domto the optional dependencies of thepackage.jsonfile? And I guess it should be the same withreact-native.Here is the full error from Yarn: