Skip to content

Commit a659bbc

Browse files
fix next dynamic ssr
1 parent 7417e72 commit a659bbc

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

nextjs-dynamic-ssr/home/pages/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ init({
2222
force: true
2323
})
2424

25-
const RemoteTitle = lazy(() => loadRemote('checkout/title'));
25+
const RemoteTitle = lazy(() => loadRemote('checkout/title').then((c)=>{
26+
if(typeof c ==='function') {
27+
return c()
28+
}
29+
return c
30+
}));
2631

2732
const Home = ({loaded}) => {
2833
return (

nextjs-dynamic-ssr/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"version": "0.0.0",
66
"scripts": {
77
"preinstall": "find . -name \"noexist\" -type d -prune -exec rm -rf '{}' +; pnpm install --ignore-scripts",
8-
"start": " pnpm --parallel --filter nextjs-dynamic-ssr_* dev",
8+
"start": "pnpm --parallel --filter nextjs-dynamic-ssr_* dev",
99
"build": "pnpm --parallel --filter nextjs-dynamic-ssr_* build",
1010
"serve": "pnpm --parallel --filter nextjs-dynamic-ssr_* start",
1111
"e2e:ci": "pnpm start & sleep 2 && wait-on tcp:3001 && wait-on tcp:3002 && wait-on tcp:3000 && npx cypress run --config-file ../cypress-e2e/config/cypress.config.ts --config '{\"supportFile\": \"../cypress-e2e/support/e2e.ts\"}' --spec \"./e2e/*.cy.ts\" --browser=chrome"

0 commit comments

Comments
 (0)