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
When I try to compile my Docusaurus v2 site (based on React) with your dependency, I get this error:
$ yarn run build[en] Creating an optimized production build...[info] [webpackbar] Compiling Client[info] [webpackbar] Compiling Server[success] [webpackbar] Client: Compiled successfully in 23.90sDocusaurus Node/SSR could not render static page with path "/" because of following error:ReferenceError: document is not defined at enableDismissTrigger (main:5763:19) at Module.9522 (main:5858:1) at __webpack_require__ (main:60951:42) at main:1596:116Pro tip: It looks like you are using code that should run on the client-side only.To get around it, try using <BrowserOnly> (https://docusaurus.io/docs/docusaurus-core/#browseronly) or ExecutionEnvironment (https://docusaurus.io/docs/docusaurus-core/#executionenvironment).It might also require to wrap your client code in useEffect hook and/or import a third-party library dynamically (if any).[success] [webpackbar] Server: Compiled with some errors in 26.57sError: Server-side rendering fails due to the error above.Unable to build website for locale "en".Error: Failed to compile with errors. at /builds/seyoon20087/seyoon20087-github-io/node_modules/@docusaurus/core/lib/webpack/utils.js:203:24 at /builds/seyoon20087/seyoon20087-github-io/node_modules/webpack/lib/MultiCompiler.js:554:14 at processQueueWorker (/builds/seyoon20087/seyoon20087-github-io/node_modules/webpack/lib/MultiCompiler.js:491:6) at processTicksAndRejections (node:internal/process/task_queues:78:11)
Thank you for submitting your issue and linking to further logs. It looks like the important part of this error is here
ReferenceError: document is not defined
at enableDismissTrigger (main:5763:19)
at Module.9522 (main:5858:1)
at __webpack_require__ (main:60951:42)
at main:1596:116
This function enableDismissTrigger is in the core bootstrap library. So, I searched for SSR issues in bootstrap and came across twbs/bootstrap#34265. It appears the problem you are encountering is that bootstrap's bundle is not SSR compatible. This issue will likely need to be resolved upstream in bootstrap itself, though it might be possible to work around the issue in this package by being smart about when it initialize's bootstraps components. I'll play around with it soon, and keep this issue open until I've found a definitive answer. Until then, I'd recommend tracking twbs/bootstrap#34265 and showing interest in that feature.
Environment Info:
Hello,
When I try to compile my Docusaurus v2 site (based on React) with your dependency, I get this error:
The full log is available in this gist.
If this could be resolved, it would be very helpful to me.
The text was updated successfully, but these errors were encountered: