Docz: Can't get a new project using Docz from scratch to work

Created on 19 Jul 2019  Β·  14Comments  Β·  Source: doczjs/docz

I created a brand new project with the goal to try out Docz v2 but I'm running into some trouble with getting Docz to start up while following the Docz getting started documentation

Here's the steps I took:

  1. created a new folder docz2
  2. inside that folder, ran npm init, answering with the default answers
  3. npm i --save-dev docz@next react react-dom
  4. I added index.mdx in the same folder with these contents:
---
name: Hello
---

Hello world!
  1. I added these to my package.json scripts
  "scripts": {
    "docz:dev": "docz dev",
    "docz:build": "docz build"
  }
  1. I ran npm run docz:dev

Next what happens is chrome is automatically loaded to localhost:3000 - but with 'This site cannot be reached'

But observing my console it looks like yarn is starting up and running gatsby develop .. and I do see an error in the console as well Cannot query field "headings" on type "DoczEntries".;

Here's my console output

npm run docz:dev

> [email protected] docz:dev /docz2
> docz dev


----------------
We need to install some dependencies in order to run your bundler.
This just happen in the first time you run docz.
This could take a while!
----------------

yarn install v0.21.3
info No lockfile found.
[1/4] πŸ”  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] πŸ”—  Linking dependencies...
warning "[email protected]" has unmet peer dependency "eslint@^5.12.0".
warning "[email protected]" has unmet peer dependency "eslint-loader@^2.1.1".
warning "@babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "[email protected]" has unmet peer dependency "graphql@^14.1.1".
warning "@emotion/[email protected]" has unmet peer dependency "@babel/core@^7.0.0".
warning "@babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "@emotion/[email protected]" has unmet peer dependency "@babel/core@^7.0.0".
warning "[email protected]" has unmet peer dependency "typescript@*".
warning "@babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0".
warning "@babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
[4/4] πŸ“ƒ  Building fresh packages...
success Saved lockfile.
✨  Done in 72.59s.
yarn dev v0.21.3
$ gatsby develop
Configuring yargs through package.json is deprecated and will be removed in the next major release, please use the JS API instead.
success open and validate gatsby-configs - 1.056 s
success load plugins - 0.475 s
success onPreInit - 0.031 s
success initialize cache - 0.037 s
success copy gatsby files - 0.116 s
success onPreBootstrap - 0.119 s
Configuring yargs through package.json is deprecated and will be removed in the next major release, please use the JS API instead.
warn The gatsby-plugin-mdx plugin has generated no Gatsby nodes. Do you need it?
success source and transform nodes - 0.284 s
success building schema - 0.379 s

 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Cannot query field "headings" on type "DoczEntries".

File: node_modules/gatsby-theme-docz/lib/createPages.js:27:10

success createPages - 0.172 s
success createPagesStatefully - 0.135 s
success onPreExtractQueries - 0.028 s
success update schema - 0.094 s
success extract queries from components - 0.383 s
success write out requires - 0.057 s
success write out redirect data - 0.063 s
success onPostBootstrap - 0.043 s
β €
info bootstrap finished - 7.458 s
β €
success run static queries - 0.095 s β€” 1/1 17.57 queries/second
success run page queries - 0.095 s β€” 3/3 144.94 queries/second
 DONE  Compiled successfully in 5670ms                                1:00:57 PM
β €
You can now view docz2 in the browser.
β €
  http://localhost:8000/
β €
View GraphiQL, an in-browser IDE, to explore your site's data and schema
β €
  http://localhost:8000/___graphql
β €
Note that the development build is not optimized.
To create a production build, use npm run build
β €
β„Ή ο½’wdmο½£:
β„Ή ο½’wdmο½£: Compiled successfully.




β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
3 pages                                                                    doc
z2
>

I noticed the message said visit 'http://localhost:8000' instead of :3000 .. so I visited there but I get a Gatsby.js development 404 page. I would expect my index.mdx content to appear.

image

Any insight or suggestions on what I may have missed?
I also tried using yarn instead of NPM and I get the same result.

bug v2

Most helpful comment

Hi guys, sorry the too late response, I was on vacation so I couldn't see any issues until now. I'll try to figure out this and fix in order to launch in the stable v2 πŸ™

All 14 comments

I am experiencing this as well. Not just you.

Also encountering this issue

Also encountering this issue

This function is unable to get heading from the MDX file.

Adding heading as following resolves the issue:

  ---
  name: Hello
  ---

+ # Hello

  Hello world!

Adding that heading does resolve the error in the build but I am still not seeing the MDX rendered with the docz UI as I would expect.

Also encountering this issue

I solved it with having STYLEGUIDE.mdx somewhere with following contents:

---
name: Home
route: /
---

# UI library

This project uses [Docz](https://www.docz.site/) for UI components development and styleguide generation.

If you never used Docz before, try [β€œGetting Started” guide](https://www.docz.site/docs/getting-started)

The important bit is route: /. If you don’t want extra homepage, you can set any component to be your root route.

I'm still not able to get this working even with the above solutions. I followed the Getting Started docs to a T.

Hi guys, sorry the too late response, I was on vacation so I couldn't see any issues until now. I'll try to figure out this and fix in order to launch in the stable v2 πŸ™

Also encountering this issue

Also getting this

Hey everyone,

Sorry for the inconvenience ! We released 2.0.0-rc.5 which has some fixes and updated the getting started guide.

Do you mind checking out the new usage example, trying it again and letting us know ?

@rakannimer Just tried it, working beautifully! Looking forward to messing with Docz again. =)

Awesome ! Thanks @crswll for reporting back :)

Closing this issue, please feel free to re-open or open another one if the problem is not fixed or re-appears !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

regrettably picture regrettably  Β·  3Comments

hayk94 picture hayk94  Β·  3Comments

ssylvia picture ssylvia  Β·  3Comments

w0wka91 picture w0wka91  Β·  3Comments

albinekb picture albinekb  Β·  3Comments