internal/fs/utils.js:658
throw new ERR_INVALID_ARG_TYPE(
^
TypeError [ERR_INVALID_ARGTYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received undefined
at Object.writeFileSync (fs.js:1380:5)
at Function..write (/Users/jiaoyueyue/.nvm/versions/node/v14.2.0/lib/node_modules/fis3/lib/util.js:733:8)
at F.save (/Users/jiaoyueyue/.nvm/versions/node/v14.2.0/lib/node_modules/fis3/lib/cache.js:45:14)
at /Users/jiaoyueyue/.nvm/versions/node/v14.2.0/lib/node_modules/fis3/node_modules/fis3-command-release/index.js:62:15
at wrapped (/Users/jiaoyueyue/.nvm/versions/node/v14.2.0/lib/node_modules/fis3/node_modules/fis3-command-release/lib/chains.js:30:58)
at Object.run (/Users/jiaoyueyue/.nvm/versions/node/v14.2.0/lib/node_modules/fis3/node_modules/fis3-command-release/lib/chains.js:39:9)
at Object.exports.run (/Users/jiaoyueyue/.nvm/versions/node/v14.2.0/lib/node_modules/fis3/node_modules/fis3-command-release/index.js:114:7)
at Object.cli.run (/Users/jiaoyueyue/.nvm/versions/node/v14.2.0/lib/node_modules/fis3/lib/cli.js:259:11)
at Liftoff. (/Users/jiaoyueyue/.nvm/versions/node/v14.2.0/lib/node_modules/fis3/bin/fis.js:36:11)
at Liftoff. (/Users/jiaoyueyue/.nvm/versions/node/v14.2.0/lib/node_modules/fis3/node_modules/liftoff/index.js:197:12) {
code: 'ERR_INVALID_ARG_TYPE'
}`
`> modName@1.0.0 build /Users/jiaoyueyue/work/bjh-react-mis
Happy[js]: Version: 5.0.1. Threads: 8 (shared pool) Happy[js]: All set; signaling webpack to proceed. Happy[babel]: Version: 5.0.1. Threads: 3 Happy[babel]: All set; signaling webpack to proceed. Happy[jsx]: Version: 5.0.1. Threads: 3 Happy[jsx]: All set; signaling webpack to proceed. Happy[css]: Version: 5.0.1. Threads: 8 (shared pool) Happy[css]: All set; signaling webpack to proceed. Happy[less]: Version: 5.0.1. Threads: 8 (shared pool) Happy[less]: All set; signaling webpack to proceed. compile success! fis release start
[INFO] Currently running fis3 (/Users/jiaoyueyue/.nvm/versions/node/v14.2.0/lib/node_modules/fis3/)
[WARNI] skip
output
directory: /Users/jiaoyueyue/work/bjh-react-mis/distinternal/fs/utils.js:658 throw new ERR_INVALID_ARG_TYPE( ^
TypeError [ERR_INVALID_ARGTYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received undefined at Object.writeFileSync (fs.js:1380:5) at Function..write (/Users/jiaoyueyue/.nvm/versions/node/v14.2.0/lib/node_modules/fis3/lib/util.js:733:8) at F.save (/Users/jiaoyueyue/.nvm/versions/node/v14.2.0/lib/node_modules/fis3/lib/cache.js:45:14) at /Users/jiaoyueyue/.nvm/versions/node/v14.2.0/lib/node_modules/fis3/node_modules/fis3-command-release/index.js:62:15 at wrapped (/Users/jiaoyueyue/.nvm/versions/node/v14.2.0/lib/node_modules/fis3/node_modules/fis3-command-release/lib/chains.js:30:58) at Object.run (/Users/jiaoyueyue/.nvm/versions/node/v14.2.0/lib/node_modules/fis3/node_modules/fis3-command-release/lib/chains.js:39:9) at Object.exports.run (/Users/jiaoyueyue/.nvm/versions/node/v14.2.0/lib/node_modules/fis3/node_modules/fis3-command-release/index.js:114:7) at Object.cli.run (/Users/jiaoyueyue/.nvm/versions/node/v14.2.0/lib/node_modules/fis3/lib/cli.js:259:11) at Liftoff. (/Users/jiaoyueyue/.nvm/versions/node/v14.2.0/lib/node_modules/fis3/bin/fis.js:36:11)
at Liftoff. (/Users/jiaoyueyue/.nvm/versions/node/v14.2.0/lib/node_modules/fis3/node_modules/liftoff/index.js:197:12) {
code: 'ERR_INVALID_ARG_TYPE'
}`
发现cache.js问题:
发现fis3里面,缓存处理的时候this.cacheFile里面的内容可能为空![image](https://user-images.githubusercontent.com/15086407/97147691-da54d480-17a4-11eb-97cc-3b16a1fcbb03.png)
但是在后面save方法里面并没有判断data的合法性,data如果为undefined,会报ERR_INVALID_ARG_TYPE错误![image](https://user-images.githubusercontent.com/15086407/97147705-e2147900-17a4-11eb-820b-760d2954645c.png)
修改cache.js代码:![image](https://user-images.githubusercontent.com/15086407/97149912-5a306e00-17a8-11eb-8cdb-03c51fdac959.png)