facebook / docusaurus

Easy to maintain open source documentation websites.
https://docusaurus.io
MIT License
55.96k stars 8.4k forks source link

"utils.getPath is not a function" on v1.2.0. #759

Closed yansern closed 6 years ago

yansern commented 6 years ago

Is this a bug report?

Yes

Have you read the Contributing Guidelines on issues?

Yes

Environment

NodeJS v8.11.2 (LTS) Yarn v1.7.0 Docusarus v1.2.0

Steps to Reproduce

  1. Update docusaurus version in package.json to ^1.2.0.
  2. Run yarn install to install new version.
  3. Run yarn start.

Then you'll get: TypeError: utils.getPath is not a function at HeaderNav.makeLinks (C:/_PATH_REMOVED_/node_modules/docusaur us/lib/core/nav/HeaderNav.js:196:15)

JoelMarcey commented 6 years ago

@yansern Hi. Thank you for the report.

Did you upgrade from a previous version of Docusaurus or was this a fresh install?

yansern commented 6 years ago

@JoelMarcey I did an upgrade. Changing back to 1.1.5 and I can run again! I’ll dig into HeaderNav.js later on 1.2.0 to see if I can find out what exactly went wrong.

JoelMarcey commented 6 years ago

Hi @yansern - can you provide me the exact commands you used when you made the update so I can try to reproduce here? Were you on 1.1.5 when you made this upgrade?

shoota commented 6 years ago

I have same problem.

   "dependencies": {
-    "docusaurus": "1.1.5"
+    "docusaurus": "1.2.0"
   },
$ docusaurus-start
Docusaurus server started on port 3000
LiveReload server started on port 35729
TypeError: utils.getPath is not a function
JoelMarcey commented 6 years ago

@shoota @yansern -- are you using npm or yarn to do the upgrade? I just tried an upgrade on a site that was on Docusaurus 1.0.9 to 1.2.0, and it worked flawlessly.

shoota commented 6 years ago

I used yarn.

JoelMarcey commented 6 years ago

Very interesting. Thanks. What version were you upgrading from? And did you just run yarn upgrade from the website directory?

shoota commented 6 years ago

Sorry..., I solved this with runningyarn upgrade in website directory. I ran yarn clean && yarn install.And my repository is mono-repository with yarn workspace and lerna.

Thanks, @JoelMarcey !!

JoelMarcey commented 6 years ago

@shoota 👍 Great!

Let me know if you can land https://github.com/userdive/agent.js/pull/641 successfully.

JoelMarcey commented 6 years ago

@yansern Did you use yarn when you ran into this issue? If so, did you run yarn upgrade in the website directory too? If not, can you try that to see if you have success like @shoota. Thanks!

JoelMarcey commented 6 years ago

I am going to close this out now. https://docusaurus.io/docs/en/next/installation#updating-your-docusaurus-version should hopefully provide the right way to upgrade.

anru commented 6 years ago

jfyi, for me reason was babel cache. If you are experiencing same issue, try clear your temporary directory or run docusaurus with BABEL_DISABLE_CACHE=1 env configuration

JoelMarcey commented 6 years ago

Thanks @anru ... 👍

Are you willing to create a PR to update the installation documentation to add your findings as a note?

Adding a note to https://github.com/facebook/Docusaurus/blob/master/docs/getting-started-installation.md#updating-your-docusaurus-version

anru commented 6 years ago

@JoelMarcey done