Docusaurus: After upgrade to 1.6.1: Error: Cannot find module '../../website/siteConfig.js'

Created on 7 Dec 2018  ·  14Comments  ·  Source: facebook/docusaurus

🐛 Bug Report

I don't know what's going on, I tried to upgrade to docusaurus 1.6.0/1.6.1 and now I'm getting Error: Cannot find module '../../website/siteConfig.js' when running npm run start. Tried several ways (remove node_modules) and also several OS (macOS, Windows) without luck.

Have you read the Contributing Guidelines on issues?

Sure

To Reproduce

(Write your steps here:)

  1. git clone https://github.com/ory/docs.git
  2. cd docs
  3. git checkout why
  4. npm i
  5. npm run start

Keep in mind that this works if you downgrade to docusaurus 1.5.1.

Expected behavior

The server should start

Actual Behavior

$ npm run start

> @ start /Users/aeneas/workspaces/js/docs/website
> docusaurus-start

internal/modules/cjs/loader.js:605
    throw err;
    ^

Error: Cannot find module '../../website/siteConfig.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
    at Function.Module._load (internal/modules/cjs/loader.js:529:25)
    at Module.require (internal/modules/cjs/loader.js:658:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.require (/Users/aeneas/workspaces/js/docs/website/node_modules/docusaurus/lib/server/utils.js:12:20)
    at Module._compile (internal/modules/cjs/loader.js:722:30)
    at Module._compile (/Users/aeneas/workspaces/js/docs/website/node_modules/pirates/lib/index.js:83:24)
    at Module._extensions..js (internal/modules/cjs/loader.js:733:10)
    at Object.newLoader [as .js] (/Users/aeneas/workspaces/js/docs/website/node_modules/pirates/lib/index.js:88:7)
    at Module.load (internal/modules/cjs/loader.js:620:32)

Most helpful comment

I am really sorry for the inconveniences caused. This is partly my mistake. I overlooked the hardcoded path on PR #1114. We will try our best to prevent such cases in the future.

Thank you very much for reporting, and commenting !

thanks

P.S I just deprecated Docusaurus v1.6.1 on NPM, please upgrade to v1.6.2

All 14 comments

If you checkout master, it will work. Here's the diff: https://github.com/ory/docs/pull/83 . I'm sorry if this sounds frustrated, but I really am. Have been trying to get this to work so hard but with every patch there is something new that doesn't work - and I'm unable to publish an important release because I can't get the docs to work properly :(

By the way, 1.6.0 is working normally.

Hi, I am having the same issue and fixed it by changing the path in: node_modules\docusaurus\lib\server\utils.js
const siteConfig = require('../../../../siteConfig.js')

I am curious on two fronts here:

  1. Is it a Babel Cache issue? Like talked about at the bottom of the installation page:

If you are finding that you are getting errors after your upgrade, try to either clear your Babel cache (usually it's in a temporary directory or run the Docusaurus server (e.g., yarn start) with the BABEL_DISABLE_CACHE=1 environment configuration.

or

  1. What happens if you wipe the node_modules directory and yarn install from scratch again?

No this is not a babel issue, it's just that someone (specifically: https://github.com/facebook/Docusaurus/blame/master/v1/lib/server/utils.js#L15 ) assumed that the path is ../../website/siteConfig.js (which might be true in development mode) but it's not when you're coming out of node_modules. It does not matter if this is yarn or npm.

The proposed fix works for me @davidbudnick

image

^ This broke it

I think it would be a good idea to have a test that uses docusaurus as a library as opposed to development mode - a e2e test. That would have probably found a lot of issues regarding the versioning, subcategory, and this one here.

@aeneasr Are you making a pull request for the issue?

I am fixing it now.

Awesome, thank you! If you can, it would be really great if you could release a hotfix patch for that too! :)

I am really sorry for the inconveniences caused. This is partly my mistake. I overlooked the hardcoded path on PR #1114. We will try our best to prevent such cases in the future.

Thank you very much for reporting, and commenting !

thanks

P.S I just deprecated Docusaurus v1.6.1 on NPM, please upgrade to v1.6.2

Don’t worry about it. Thank you for the amazingly fast response time, not common in OSS! :)

On 7. Dec 2018, at 19:26, Endilie Yacop Sucipto notifications@github.com wrote:

I am really sorry for the inconveniences caused. This is partly my mistake. I overlooked the hardcoded path on PR #1114. We will try our best to prevent such cases in the future.

Thank you very much for reporting, and commenting !

P.S I just deprecated Docusaurus v1.6.1 on NPM, please upgrade to v1.6.2


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sebqq picture sebqq  ·  3Comments

NikitaIT picture NikitaIT  ·  3Comments

rickyvetter picture rickyvetter  ·  3Comments

microbouji picture microbouji  ·  3Comments

awibox picture awibox  ·  3Comments