Can't upgrade v2 from alpha.55 -> alpha.61 -Can't resolve 'docsearch.js'
See original GitHub issueš Bug Report
Thank you for docusaurus and Version 2 is already incredible.
I am trying to upgrade from alpha.55 to version alpha.61. I canāt tell what I am doing wrong but I am getting an error
Failed to compile
./src/theme/SearchBar/index.js
Module not found: Can't resolve 'docsearch.js' in '/Users/david/repos/erxes/docs/src/theme/SearchBar'
Have you read the Contributing Guidelines on issues?
Yes, I have read this.
To Reproduce
- In my package.json, under the dependences, change from version alpha.55, to version alpha.61
"@docusaurus/core": "^2.0.0-alpha.61",
"@docusaurus/preset-classic": "^2.0.0-alpha.61",
- In the terminal, in the directory for ā/docsā, run
yarn install
to install upgraded version - Then run
yarn start
Expected behavior
I expected to have my installation work in the browser, and to be able to continue developing my app.
Actual Behavior
Something went wrong:
-
I got a bunch of warnings- but I donāt think this is the cause.
-
I ran
yarn start
. I got an errorValidationError: "homePageId" is not allowed to be empty
So, in the docusaurus.config.js, I commented out homepageId
<-- which was in empty quotes. (I have no idea what to put in there, I tried ādocs/ā. Either way I am able to continue with the installation. I tried with and without docs/
(See below)
- I ran
yarn start
again. I got a reasonable error message,ValidationError: themeConfig.navbar.links has been renamed as themeConfig.navbar.items
So, in the docusaurus.config.js, I changed themeConfig.navbar.links
to themeConfig.navbar.items
.
- I ran
yarn start
again. I got an errorValidationError: "navbar.items[0].activeBasePath" is not allowed to be empty
I had two .items with activeBasePath
, both were empty string quotes, and I commented both of them out.
- I ran
yarn start again
. This time it seemed to run, but I got the following errors, in my terminal:
The same error in my browser,
Failed to compile
./src/theme/SearchBar/index.js
Module not found: Can't resolve 'docsearch.js' in '/Users/david/repos/erxes/docs/src/theme/SearchBar'
Note:
- Everything was working great before the upgrade, but I wanted to upgrade
- I have done the above steps 5 times with exactly the same results
- I searched the docs, github and google and cannot find any reference to this issue. I suspect this is something I am doing wrong, and not necessarily a docusaurus issue.
Your Environment
- Docusaurus version used: upgrading from version 2 alpha.55 to alpha.61
- Environment name and version (e.g. Chrome 78.0.3904.108, Node.js 10.17.0): on a Mac with latest Node
Reproducible Demo
This is the link to the repo with the above issue.
https://github.com/erxes/erxes/tree/docusaurus-upgrade-error
(Note: It is part of a larger mono-repo for erxes.)
Thank you.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
@davidkartuzinski New release contains an update to algolia search plugin and due to your website swizzles searchBar it is broken.
@anshulrgoyal - No problem about the errors! They makes sense. I understand this is alpha, and it is already so polished with in terminal messages and instructions! So great. I consider this issue my ignorance, not anything āwrongā with docusaurus.
Your instructions helped me to understand what was happening. What I did to fix this issue was to go into the node_modules/@docusaurus/ and delete the @docusaurus/theme-search-algolia, then at the terminal I just simply ran
yarn add @docusaurus/theme-search-algolia
and everything now works.Again thank you for your incredibly fast response. This issue is resolved for me.
I wanted to add that simply removing it didnāt fix the issue. Also simply just installing it didnāt work either. I had to delete it from the. node_modules, and then reinstall it.