Comments (2)
Hey, thank you for opening this issue, we appreciate it! Just a quick introduction about how docz actually works underneath, we use gatsby behind the scenes to run and build your documentation output, but before doing it, we oversearch for your mdx files into your source folder (default /src
) to parse them into HTML through gatsby, but unfortunately, we still don't have any good workaround when any of these files are not found, which it currently results in a misconception error. So, it probably goes away once you start adding mdx files to your /src
folder. Try to do that and let us know if you're still struggling with gatsby building problems. I'll be closing it for now as we already have a specific issue to fix that!
from docz.
Thanks for sharing how it works!
Unfortunately the problem persists even when there is an .mdx
file present in /src
.
$ pnpm exec docz dev
Building app
node:events:368
throw er; // Unhandled 'error' event
^
Error: spawn /home/wayne/code/issue-docz-pnpm-compat/node_modules/.bin/gatsby ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
at onErrorNT (node:internal/child_process:477:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (node:internal/child_process:288:12)
at onErrorNT (node:internal/child_process:477:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn /home/wayne/code/issue-docz-pnpm-compat/node_modules/.bin/gatsby',
path: '/home/wayne/code/issue-docz-pnpm-compat/node_modules/.bin/gatsby',
spawnargs: [ 'develop', '--host', 'localhost', '--port', '3000' ]
}
I've tried to figure it out and so far it looks like it's due to non-flat node_modules folder.
Removing node_modules and running npm i
allows gatsby
to run.
https://pnpm.io/motivation#creating-a-non-flat-node_modules-directory
Adding node-linker=hoisted
to .npmrc
helps relieve that problem for pnpm
and mimics the behaviour expected by npm
.
Looking at Gastby docs, it seem it doesn't support pnpm
by default: https://www.gatsbyjs.com/docs/reference/gatsby-cli/#how-to-change-your-default-package-manager-for-your-next-project
This can be addressed with a webpack plugin: https://www.gatsbyjs.com/plugins/gatsby-plugin-pnpm/
Off topic of pnpm, I think an idea is to install dependencies into /.docz
to isolate the project, and symlink /src
to /.docz/src
for resolution rather than copying it.
from docz.
Related Issues (20)
- node_modules\.bin\gatsby HOT 3
- gh repo clone github/docs HOT 1
- Port not used from custom gatsby-config.js file
- Can't resolve '@emotion/core' HOT 9
- Error on first install. nError handler for invocation 'building-schema', error was 'TypeError: (0 , _buildASTSchema.getDescription) HOT 2
- Test out possibly breaking changes on security updates made from dependabot pull-requests HOT 3
- What font is used in Docz image? HOT 3
- Error in setting up development environment HOT 4
- Release notes for 2.4.0 are missing HOT 1
- Multiple errors after installing docz HOT 11
- Error while initializing babel in docz HOT 3
- Can't resolve '@babel/runtime/helpers/esm/regeneratorRuntime'
- Error: Cannot find module 'typescript' docz HOT 2
- Add a visible notice on the documentation on why docz will not work
- Can we say that the project is Dead now? What are the alternatives? HOT 1
- how to use in react 18 HOT 4
- Error docz build
- When I try to run the project in the development environment, I get the following error: HOT 1
- An error occurred while accessing the file after local packaging.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docz.