We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
使用npm link在本地调试ykfe-utils时报上图错误,但直接用npm install使用node_modules中的ykfe-utils无以上错误
The text was updated successfully, but these errors were encountered:
原因:由于我们在ykfe-utils中用到了withRouter这个方法,这个方法使用的时候上下文必须包含Router,我们在自己应用的entry.js中用browserRouter将其包裹,但在本地link开发时,ykfe-utils使用的react-router实例是自身的node_modules中的react-router。
解决方式: 保证全局只有一个react-router实例出现,使用webpack alias
// webpack.config.client.js resolve: { alias: { // for this issue https://github.com/ykfe/egg-react-ssr/issues/36 'react-router': require.resolve('react-router') } },
Sorry, something went wrong.
44281e0
No branches or pull requests
使用npm link在本地调试ykfe-utils时报上图错误,但直接用npm install使用node_modules中的ykfe-utils无以上错误
The text was updated successfully, but these errors were encountered: