Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fis3中cache.jsbug #1319

Open
codedaybyday opened this issue Oct 26, 2020 · 2 comments
Open

fis3中cache.jsbug #1319

codedaybyday opened this issue Oct 26, 2020 · 2 comments

Comments

@codedaybyday
Copy link

  • 操作系统:
    macos
  • Node版本:
    node 12
  • FIS版本:
    fis3
  • 解决方案:
  • 依赖插件:

`> [email protected] build /Users/jiaoyueyue/work/bjh-react-mis

node --max_old_space_size=4096 server/build.js

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/dist

internal/fs/utils.js:658
throw new ERR_INVALID_ARG_TYPE(
^

TypeError [ERR_INVALID_ARG_TYPE]: 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

但是在后面save方法里面并没有判断data的合法性,data如果为undefined,会报ERR_INVALID_ARG_TYPE错误
image

修改cache.js代码:
image

@MingRrrr
Copy link

这个bug有没有大佬修一下啊,fis和fis3都有问题,我们组的这个问题我都是直接把cache file加强转转成字符串。。。

@oxUnd
Copy link
Contributor

oxUnd commented Nov 27, 2020

提个mr上来?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants