Hi there, has anybody else get this error when running npm run build?
I started getting error like these using v1, then I thought using v2 should solve it but it didn't.
Here is an screenshot, I'm getting the same error either in Ubuntu or MacOS, running Node 8.11 and 9.10

Thanks in advance.
Same error here
same ... :(
Running the following command the error stopped for me:
rm yarn.lock && rm -rf node_modules && yarn && yarn build
@Leocardoso94 it worked for me too. Thanks so much!
@Leocardoso94 Worked for me as well, thanks a lot!.
Still very strange, i had the same issue on a fresh install in the morning and i received the same errors. But now a fresh install works out of the box. Probably a dependency issue somewhere in the jungle that is node_modules
@arxae May be related with a webpack dependency, very strange indeed.
got the same error and a fresh yarn build doesn't work for me
Same error for me with v1.
Same error here as well - digging in the dependency hell :)
temporarily fixed by remove some unused import React, and change the name of React to others in some import React from 'react'.
related to this one: https://github.com/umijs/umi/pull/1187
guys you can delete the require.resolve('babel-plugin-react-require'), in babel-preset-umi/lib/index.js and retry building.
this plugin imports another react object into context, causing it conflict with the original one in ant design's code
guys you can delete the
require.resolve('babel-plugin-react-require'),inbabel-preset-umi/lib/index.jsand retry building.this plugin imports another react object into context, causing it conflict with the original one in ant design's code
Thanks! BTW, I'm wondering if there's a more graceful way to fix that? cause it may be inconvenient to delete code in CI&CD.
Most helpful comment
Running the following command the error stopped for me:
rm yarn.lock && rm -rf node_modules && yarn && yarn build