doczjs / docz

✍ It has never been so easy to document your things!
https://docz.site
MIT License
23.6k stars 1.46k forks source link

Parent directory as "src" breaks docz #1610

Open Tismas opened 3 years ago

Tismas commented 3 years ago

Bug Report

Describe the bug

Mdx files are not picked up when src is set to parent directory (although they're visible in graphql). Also build takes a very long time like node_modules were getting parsed. With bigger project I had errors from md files in node_modules but I couln't reproduce it here

To Reproduce

Repo: https://github.com/Tismas/docz-problem

Run yarn && cd docz && yarn && yarn docz:dev

I'm getting this error during bulding process:

ERROR #85923  GRAPHQL

There was an error in your GraphQL query:

Cannot query field "allDoczEntries" on type "Query".

If you don't expect "allDoczEntries" to exist on the type "Query" it is most likely a typo.
However, if you expect "allDoczEntries" to exist there are a couple of solutions to common problems:

- If you added a new data source and/or changed something inside gatsby-node.js/gatsby-config.js, please try a restart of your development server
- The field might be accessible in another subfield, please try your query in GraphiQL and use the GraphiQL explorer to see which fields you can query and what shape they have

It is recommended to explicitly type your GraphQL schema if you want to use optional fields. This way you don't have to add the mentioned "dummy content". Visit our docs to learn how you can define the schema for "Query":
https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions

File: ..\node_modules\gatsby-theme-docz\lib\createPagesStatefully.js:28:10

Expected behavior

Docz works with parent directory as src and/or I'm able to provide multiple entrypoints like this: src: ["../package1/src", "../package2/src"] Node_modules are not getting parsed wherever they are

Environment

Additional context/Screenshots We have a monorepo and we would like to have docz as one of the lerna packages while keeping mdx files near components in other packages.

iryanclarke commented 3 years ago

I've had similar issues!

Basically, Docz just seems to totally get it's configuration when you try and reference anything a directory above itself. I've received the same GQL errors, along with it "building" properly, only to then display a page that just says "Not Found".

It's unfortunate that the maintainer has seemingly dropped off the planet, as there hasn't been any updates to the repo in quite some time, and especially with Gatsby 3.0 coming out, it may just become stale

FrederikStenbergPedersen commented 2 years ago

This is still very relevant. Setting src to any value, verified as correct paths (it doesn't throw the path error so it damn well knows it is the correct path as well), simply returns in the GraphQL error, which means it basically didn't find any *.mdx files.'