Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
aeneasr opened this issue Dec 7, 2018 · 14 comments
Closed

Comments

@aeneasr
Copy link
Contributor

aeneasr commented Dec 7, 2018

🐛 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)
@aeneasr
Copy link
Contributor Author

aeneasr commented Dec 7, 2018

If you checkout master, it will work. Here's the diff: ory/docs#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 :(

@aeneasr
Copy link
Contributor Author

aeneasr commented Dec 7, 2018

By the way, 1.6.0 is working normally.

@davidbudnick
Copy link

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')

@JoelMarcey
Copy link
Contributor

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?

@aeneasr
Copy link
Contributor Author

aeneasr commented Dec 7, 2018

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.

@aeneasr
Copy link
Contributor Author

aeneasr commented Dec 7, 2018

The proposed fix works for me @davidbudnick

@davidbudnick
Copy link

davidbudnick commented Dec 7, 2018

image

^ This broke it

@aeneasr
Copy link
Contributor Author

aeneasr commented Dec 7, 2018

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.

@davidbudnick
Copy link

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

@JoelMarcey
Copy link
Contributor

I am fixing it now.

@aeneasr
Copy link
Contributor Author

aeneasr commented Dec 7, 2018

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

@JoelMarcey
Copy link
Contributor

#1150

@endiliey
Copy link
Contributor

endiliey commented Dec 7, 2018

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

@aeneasr
Copy link
Contributor Author

aeneasr commented Dec 7, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants