Closed markgong-gd closed 3 years ago
I have the same error! Up!
Is there any update here ? Anybody has any solution ?
Hey everyone! That's actually super weird happening here, because doczDb
is definitely something expected to docz core properly create dynamically the gatsby project for you. This actually is expected to be done in pre-build stage, so it's possible that a message has been shown on the build process, maybe telling what happened. This error is happening in runtime, right?
Then, can you provide a complety snapshot of your entire log after run docz build
@markgong-gd?
Exactly the same thing is happening from your side @yunusture? Let me know, please. So we can try to help you guys ASAP.
I believe as many details as you have, and share, faster it'll be solved 🙂
Even because, this is an important one, so as long as we can reproduce it, we probably will find out how to fix it.
@renatobenks ,Hi and thanks for response :) I have an ongoing project which we want to provide some documentation. Inside the project,I run yarn add docz and After that I am adding the scripts for running the docz. My project uses the latest react 17. And at first I thought that is the problem but no.Now I changed my react and react-dom versions to 16.12 and still same errors happening.Here My steps and logs : 1) yarn add docz 2) add "docz:dev": "docz dev","docz:build": "docz build", "docz:serve": "docz build && docz serve" scripts. 3) yarn docz:dev . 4) logs after these commands:
` yarn install v1.22.10 [1/4] Resolving packages... [2/4] Fetching packages... info fsevents@2.3.2: The platform "linux" is incompatible with this module. info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation. info fsevents@1.2.13: The platform "linux" is incompatible with this module. info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... warning " > docz@2.3.1" has incorrect peer dependency "react@^16.8.0". warning " > docz@2.3.1" has incorrect peer dependency "react-dom@^16.8.0". warning "docz > gatsby-plugin-eslint@2.0.8" has incorrect peer dependency "eslint@^6.6.0". warning "docz > gatsby-plugin-eslint@2.0.8" has unmet peer dependency "eslint-loader@^3.0.2". warning "docz > gatsby-theme-docz@2.3.1" has incorrect peer dependency "react@^16.8.0". warning "docz > gatsby-theme-docz@2.3.1" has incorrect peer dependency "react-dom@^16.8.0". warning "docz > gatsby > @reach/router@1.3.4" has incorrect peer dependency "react@15.x || 16.x || 16.4.0-alpha.0911da3". warning "docz > gatsby > @reach/router@1.3.4" has incorrect peer dependency "react-dom@15.x || 16.x || 16.4.0-alpha.0911da3". warning "docz > gatsby-theme-docz > react-resize-detector@4.2.3" has incorrect peer dependency "react@^16.0.0". warning "docz > gatsby-theme-docz > react-resize-detector@4.2.3" has incorrect peer dependency "react-dom@^16.0.0". warning "docz > gatsby-theme-docz > theme-ui@0.2.52" has incorrect peer dependency "react@^16.8.0". warning "docz > gatsby > @reach/router > create-react-context@0.3.0" has incorrect peer dependency "react@^0.14.0 || ^15.0.0 || ^16.0.0". warning "docz > gatsby-theme-docz > react-live > react-simple-code-editor@0.10.0" has incorrect peer dependency "react@^16.0.0". warning "docz > gatsby-theme-docz > react-live > react-simple-code-editor@0.10.0" has incorrect peer dependency "react-dom@^16.0.0". warning "docz > gatsby-theme-docz > rehype-docz > react-ace@7.0.5" has incorrect peer dependency "react@^0.13.0 || ^0.14.0 || ^15.0.1 || ^16.0.0". warning "docz > gatsby-theme-docz > rehype-docz > react-ace@7.0.5" has incorrect peer dependency "react-dom@^0.13.0 || ^0.14.0 || ^15.0.1 || ^16.0.0". [4/4] Building fresh packages... $ node ./node_modules/husky/lib/bin install husky - Git hooks installed Done in 16.37s. yarn run v1.22.10 $ docz dev --port 1337
Building app info We're shipping new features! For final testing, we're rolling them out first to a small % of Gatsby users and your site was automatically chosen as one of them. With your help, we'll then release them to everyone in the next minor release.
We greatly appreciate your help testing the change. Please report any feedback good or bad in the umbrella issue. If you do encounter problems, please disable the flag by setting it to false in your gatsby-config.js like:
flags: { THE_FLAG: false }
The following flags were automatically enabled on your site:
success open and validate gatsby-configs - 0.878s success load plugins - 0.409s success onPreInit - 0.047s success initialize cache - 0.018s success copy gatsby files - 0.089s success onPreBootstrap - 0.051s success createSchemaCustomization - 0.003s TypeError: repo.browsetemplate.replace is not a function at getRepoEditUrl (/user/node_modules/docz-core/dist/index.js:772:63) at new Entries (/user/node_modules/docz-core/dist/index.js:1287:24) at Object.module.exports (/user/node_modules/gatsby-theme-docz/lib/sourceNodes.js:18:19) at processTicksAndRejections (node:internal/process/task_queues:93:5) at runAPI (/user/node_modules/gatsby/src/utils/api-runner-node.js:485:16)
ERROR #11321 PLUGIN
"gatsby-theme-docz" threw an error while running the sourceNodes lifecycle:
repo.browsetemplate.replace is not a function
TypeError: repo.browsetemplate.replace is not a function
index.js:745 getRepoUrl [editor-workspace]/[docz-core]/dist/index.js:745:62
index.js:783 getInitialConfig [editor-workspace]/[docz-core]/dist/index.js:783:19
index.js:817 Object.state [as config] [editor-workspace]/[docz-core]/dist/index.js:817:19
sourceNodes.js:23 Object.module.exports [editor-workspace]/[gatsby-theme-docz]/lib/sourceNodes.js:23:12
task_queues:93 processTicksAndRejections node:internal/process/task_queues:93:5
api-runner-node.js:485 runAPI [editor-workspace]/[gatsby]/src/utils/api-runner-node.js:485:16
warn The gatsby-theme-docz plugin has generated no Gatsby nodes. Do you need it? success Checking for changed pages - 0.001s success source and transform nodes - 0.691s success building schema - 0.324s info Total nodes: 72, SitePage nodes: 1 (use --verbose for breakdown) success createPages - 0.008s success Checking for changed pages - 0.002s
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:
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
success createPagesStatefully - 0.128s success update schema - 0.027s success write out redirect data - 0.002s success onPostBootstrap - 0.004s info bootstrap finished - 4.995s success onPreExtractQueries - 0.002s
ERROR #85923 GRAPHQL
There was an error in your GraphQL query:
Cannot query field "doczDb" on type "Query".
If you don't expect "doczDb" to exist on the type "Query" it is most likely a typo. However, if you expect "doczDb" to exist there are a couple of solutions to common problems:
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/src/hooks/useDbQuery.js:7:9
failed extract queries from components - 0.085s success write out requires - 0.004s success run page queries - 0.028s - 2/2 71.61/s ⠀ You can now view docz-app in the browser. ⠀ http://localhost:1337/ ⠀ View GraphiQL, an in-browser IDE, to explore your site's data and schema ⠀ http://localhost:1337/___graphql ⠀ Note that the development build is not optimized. To create a production build, use gatsby build ⠀ success Building development bundle - 12.103s info changed file at /user/package.json info changed file at /user/package.json success building schema - 0.302s info Total nodes: 74, SitePage nodes: 3 (use --verbose for breakdown) success createPages - 0.007s success Checking for changed pages - 0.003s success update schema - 0.039s success onPreExtractQueries - 0.002s
ERROR #85923 GRAPHQL
There was an error in your GraphQL query:
Cannot query field "doczDb" on type "Query".
If you don't expect "doczDb" to exist on the type "Query" it is most likely a typo. However, if you expect "doczDb" to exist there are a couple of solutions to common problems:
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/src/hooks/useDbQuery.js:7:9
failed extract queries from components - 0.044s success write out requires - 0.002s`
@renatobenks also same , when I change my react and react-dom version to "^16.8.0".
Also I am using linux and when I run npx create-docz-app my-docz-app , I got differant errors : ` Creating a new Docz app in /home/ynsture/Desktop/Development/my-docz-app.
Downloading files for example basic. This might take a moment.
Aborting installation.
Unexpected error. Please report it as a bug:
TypeError: e.destroy is not a function
at /home/ynsture/.npm/_npx/f6e6de91721365f0/node_modules/create-docz-app/dist/index.js:2:35630
at Array.forEach (
npm ERR! code 1 npm ERR! path /home/ynsture/Desktop/Development npm ERR! command failed npm ERR! command sh -c create-docz-app my-docz-app
npm ERR! A complete log of this run can be found in:`
Hmm, thanks for sharing it in such detail, it'll be helpful! This will take some investigation to reproduce and see what's happening. But in case you be able to create a reproducible environment in a repo, or even in a codesandbox for example, would be nice!
@renatobenks here the sandbox :https://stackblitz.com/edit/node-nbg3zf?file=public%2Findex.html . Hope you can fix it .
Awesome! Yes, sure, we'll fix it!
Hey, everyone having this issue, it actually happens when you don't have any markdown file to be reached and parsed by docz to build your site. So, even though it's not ideally expected, obviously, if you just add some component markdown file in your codebase, you can pick some example from our docs, or getting started, it'll probably gonna work.
Either way, I'm writing a workaround to avoid this issue for good, and stop people of struggle on that without understanding what actually it's happening.
So, I'm closing this issue for now, but let me know guys you're experiencing something different than this.
Bug Report
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Please try to build a small repo with a repro of your problem and provide a link to it.
Doing that allows more people to quickly help you.
If you can't provide a repo then provide clear steps describing how to reproduce the issue.
There was an error in your GraphQL query: Cannot query field "doczDb" on type "Query".
If you don't expect "doczDb" to exist on the type "Query" it is most likely a typo. However, if you expect "doczDb" to exist there are a couple of solutions to common problems:
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: E:/self/rc-ui/node_modules/gatsby-theme-docz/src/hooks/useDbQuery.js
Expected behavior
A clear and concise description of what you expected to happen..
Environment
Additional context/Screenshots Add any other context about the problem here. If applicable, add screenshots to help explain.