
Environment
my package.json
"dependencies": {
"@babel/core": "^7.0.0",
"antd": "3.8.2",
"autobind-decorator": "2.1.0",
"axios": "0.18.0",
"classnames": "2.2.6",
"docz": "0.10.3",
"docz-plugin-css": "0.10.3",
"downloadjs": "1.4.7",
"dva": "2.4.0",
"echarts": "4.1.0",
"echarts-wordcloud": "1.1.3",
"hanabi": "0.4.0",
"lodash": "4.17.10",
"mobx": "4.3.1",
"mobx-react": "5.2.5",
"mzmu": "1.8.18",
"ramda": "0.25.0",
"react-immutable-render-mixin": "0.9.7",
"react-jsx-parser": "1.5.1",
"simple-line-icons": "2.4.1",
"typescript": "2.9.2",
"umi": "2.0.0-beta.16"
},
"devDependencies": {
"@types/echarts": "0.0.12",
"@types/lodash": "4.14.116",
"@types/node": "9.6.28",
"@types/react": "16.4.11",
"babel-plugin-module-resolver": "3.1.1",
"ts-jest-babel-7": "22.0.7",
"typedoc": "0.11.1",
"umi-plugin-dva": "0.9.1"
}
but theme same project in my macbook can run docz:dev && docz:build
@amily4555 It isn`t error from docz, look for npm ERR! No Space left on device
3q,
I will update npm to the latest version to see if there is still this problem.
We are having a similar issue during a Netlify deployment when we added too many packages from NPM. The ENOSPC may not be because of a lack of disk space, but a limit being reached on the files being watched. When docz builds a production build, something (webpack perhaps) is using chokidar to watch node_modules.
An update to our issue. There is a chokidar watcher set up to watch for changes to .mdx files, which if you do not configure the path yourself will default to **/*.mdx. This causes chokidar to watch.. a lot of files, including node_modules/.cache and .docz/cache which, during a production build, change often on a dry start.
If you ran the command enough times, it would eventually work, once the cache had warmed up. (Different machines, different results. We had this issue on Netlify)
The default is set here:
https://github.com/pedronauck/docz/blob/035ec02390459ba70ebd63c8477d001426a1fb8b/packages/docz-core/src/commands/args.ts#L97
If the default was prefixed with config.base property, it would limit the scope of this watcher a lot. Our solution in the mean time was to manually, in our doczrc.js set the files to a new pattern:
export default {
src: './src/components',
files: 'src/components/**/*.mdx',
}
Which resolved our issues.
That's a really good point, I'll look into this to try to avoid this type of unnecessary watch! Thanks to the tip @stephenwf 🙏
Fixed in the new v0.11.1 ✅
Most helpful comment
An update to our issue. There is a
chokidarwatcher set up to watch for changes to.mdxfiles, which if you do not configure the path yourself will default to**/*.mdx. This causeschokidarto watch.. a lot of files, includingnode_modules/.cacheand.docz/cachewhich, during a production build, change often on a dry start.If you ran the command enough times, it would eventually work, once the cache had warmed up. (Different machines, different results. We had this issue on Netlify)
The default is set here:
https://github.com/pedronauck/docz/blob/035ec02390459ba70ebd63c8477d001426a1fb8b/packages/docz-core/src/commands/args.ts#L97
If the default was prefixed with
config.baseproperty, it would limit the scope of this watcher a lot. Our solution in the mean time was to manually, in ourdoczrc.jsset the files to a new pattern:Which resolved our issues.