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

运行分析的时候报错 #4

Open
tbswang opened this issue Feb 18, 2022 · 2 comments
Open

运行分析的时候报错 #4

tbswang opened this issue Feb 18, 2022 · 2 comments

Comments

@tbswang
Copy link

tbswang commented Feb 18, 2022

现象:在运行分析命令是报错了,报错信息没什么有用的,尝试了项目中是其他目录,也是同样的报错

lemonj analysis src      
Code Smell:  {
  colors: 0,
  importants: 0,
  issues: 0,
  mediaQueries: 0,
  absolute: 0,
  oddWidth: 0
}
internal/fs/utils.js:793
  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:1517:5)
    at analysisDir (/Users/xxx/.nvm/versions/node/v14.17.6/lib/node_modules/lemonj/dist/cli.js:31271:15)
    at Command2.<anonymous> (/Users/xxx/.nvm/versions/node/v14.17.6/lib/node_modules/lemonj/dist/cli.js:31491:3)
    at Command2.listener [as _actionHandler] (/Users/xxx/.nvm/versions/node/v14.17.6/lib/node_modules/lemonj/dist/cli.js:258:33)
    at Command2._parseCommand (/Users/xxx/.nvm/versions/node/v14.17.6/lib/node_modules/lemonj/dist/cli.js:555:16)
    at Command2._dispatchSubcommand (/Users/xxx/.nvm/versions/node/v14.17.6/lib/node_modules/lemonj/dist/cli.js:518:20)
    at Command2._parseCommand (/Users/xxx/.nvm/versions/node/v14.17.6/lib/node_modules/lemonj/dist/cli.js:527:14)
    at Command2.parse (/Users/xxx/.nvm/versions/node/v14.17.6/lib/node_modules/lemonj/dist/cli.js:424:12)
    at Object.<anonymous> (/Users/xxx/.nvm/versions/node/v14.17.6/lib/node_modules/lemonj/dist/cli.js:31498:9)
    at Module._compile (internal/modules/cjs/loader.js:1072:14) {
  code: 'ERR_INVALID_ARG_TYPE'
}

版本: 0.2.0

css版本: scss

@phodal
Copy link
Member

phodal commented Feb 18, 2022

定位到问题了:

lemonj/src/Analysis.ts

Lines 64 to 68 in 68e1bc2

function buildSortMapping(data) {
if (Object.keys(data.colorMappings).length === 0) {
return;
}

这里生成判断值为 0 的时候,返回的是个 undefined,所以就挂了。

有兴趣来个 pr 吗?

@tbswang
Copy link
Author

tbswang commented Feb 21, 2022

定位到问题了:

lemonj/src/Analysis.ts

Lines 64 to 68 in 68e1bc2

function buildSortMapping(data) {
if (Object.keys(data.colorMappings).length === 0) {
return;
}

这里生成判断值为 0 的时候,返回的是个 undefined,所以就挂了。

有兴趣来个 pr 吗?

多谢,我试试

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

2 participants