Docusaurus: "utils.getPath is not a function" on v1.2.0.

Created on 11 Jun 2018  路  14Comments  路  Source: facebook/docusaurus

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)

Most helpful comment

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

All 14 comments

@yansern Hi. Thank you for the report.

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

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

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?

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

@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.

I used yarn.

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

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 !!

@shoota 馃憤 Great!

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

@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!

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.

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

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

@JoelMarcey done

Was this page helpful?
0 / 5 - 0 ratings

Related issues

azu picture azu  路  3Comments

philipmjohnson picture philipmjohnson  路  3Comments

MoogyG picture MoogyG  路  3Comments

omry picture omry  路  3Comments

endiliey picture endiliey  路  3Comments