You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
parts.push(`It looks like you are using code that should run on the client-side only.
56
+
To get around it, try using \`<BrowserOnly>\` (https://docusaurus.io/docs/docusaurus-core/#browseronly) or \`ExecutionEnvironment\` (https://docusaurus.io/docs/docusaurus-core/#executionenvironment).
57
+
It might also require to wrap your client code in \`useEffect\` hook and/or import a third-party library dynamically (if any).`);
58
+
}
59
+
60
+
returnparts.join('\n');
61
+
}
62
+
40
63
exportdefaultasyncfunctionrender(
41
64
locals: Locals&{path: string},
42
65
): Promise<string>{
43
66
try{
44
67
returnawaitdoRender(locals);
45
-
}catch(err){
46
-
// We are not using logger in this file, because it seems to fail with some
47
-
// compilers / some polyfill methods. This is very likely a bug, but in the
48
-
// long term, when we output native ES modules in SSR, the bug will be gone.
49
-
// prettier-ignore
50
-
console.error(chalk.red(`${chalk.bold('[ERROR]')} Docusaurus server-side rendering could not render static page with path ${chalk.cyan.underline(locals.path)}.`));
console.info(`${chalk.cyan.bold('[INFO]')} It looks like you are using code that should run on the client-side only.
58
-
To get around it, try using ${chalk.cyan('`<BrowserOnly>`')} (${chalk.cyan.underline('https://docusaurus.io/docs/docusaurus-core/#browseronly')}) or ${chalk.cyan('`ExecutionEnvironment`')} (${chalk.cyan.underline('https://docusaurus.io/docs/docusaurus-core/#executionenvironment')}).
59
-
It might also require to wrap your client code in ${chalk.cyan('`useEffect`')} hook and/or import a third-party library dynamically (if any).`);
0 commit comments