eosnetworkfoundation / docsgen

Scripts for creating docs.eosnetwork.com pulls from various eos nf repos and builds static HTML to power website
Other
3 stars 0 forks source link

Build throws error after docusaurus 2.4.0 upgrade #105

Closed lparisc closed 1 year ago

lparisc commented 1 year ago

Build log:

[INFO] [en] Creating an optimized production build... ℹ️ Compiling Client ℹ️ Compiling Server ✔️ Client: Compiled successfully in 4.84m ✔️ Server: Compiled with some errors in 5.22m

[ERROR] Docusaurus server-side rendering could not render static page with path /search.

TypeError: (0 , _docusaurus_theme_common_internal__WEBPACK_IMPORTED_MODULE_15__.useSearchPage) is not a function

[INFO] Docusaurus version: 2.4.0 Node version: v18.12.1

ericpassmore commented 1 year ago

Was able to upgrade after removing the custom theme from the last redesign. Commented out the following the generate_documents.sh

###
# Install Theme Updates
Install_DOC6S_Theme() {
  #cp -r "${SCRIPT_DIR:?}/../web/docusaurus/src/components" "${ARG_BUILD_DIR:?}/devdocs/src/"
  #cp -r "${SCRIPT_DIR:?}/../web/docusaurus/src/css" "${ARG_BUILD_DIR:?}/devdocs/src/"
  #cp -r "${SCRIPT_DIR:?}/../web/docusaurus/src/hooks" "${ARG_BUILD_DIR:?}/devdocs/src/"
  #cp -r "${SCRIPT_DIR:?}/../web/docusaurus/src/pages" "${ARG_BUILD_DIR:?}/devdocs/src/"
  #cp -r "${SCRIPT_DIR:?}/../web/docusaurus/src/theme" "${ARG_BUILD_DIR:?}/devdocs/src/"
  cp -r "${SCRIPT_DIR:?}/../web/docusaurus/static" "${ARG_BUILD_DIR:?}/devdocs/"
}
ericpassmore commented 1 year ago

useSearchPage, not longer exists it was split into two functions , useSearchLinkCreator and useSearchQueryString https://github.com/facebook/docusaurus/pull/8757/files

Need to update web/docusaurus/src/theme/SearchBar/index.js and web/docusaurus/src/theme/SearchPage/index.js

lparisc commented 1 year ago

Solved