Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: workaround for ssr failed since umi@4.0.53 #1503

Merged
merged 1 commit into from
Feb 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/features/derivative.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,4 +217,23 @@ export default (api: IApi) => {

// FIXME: skip prepare plugin since umi@4.0.48, because it is not compatible with dumi currently
if (api.isPluginEnable('prepare')) api.skipPlugins(['prepare']);

// skip routeProps plugin since umi@4.0.53
// because dumi support conventional route props by default and it will cause ssr failed
if (api.isPluginEnable('routeProps')) {
api.skipPlugins(['routeProps']);

// FIXME: write a empty routeProps file to avoid umi throw error, should be removed after umi fixed
api.onGenerateFiles({
// make sure before umi generate files
stage: -Infinity,
fn() {
api.writeTmpFile({
noPluginDir: true,
path: 'core/routeProps.js',
content: 'export default {}',
});
},
});
}
};