nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
22.69k stars 2.27k forks source link

`nx format:write --all` fails with `ENAMETOOLONG: name too long` #8336

Closed pemsbr closed 2 years ago

pemsbr commented 2 years ago

Current Behavior

nx format:write --all fails with ENAMETOOLONG: name too long.

prettier -write . works as expected.

Expected Behavior

Why are all the prettier supported languages being used in the glob pattern? Not only is it causing this problem but it's skipping some files such as .babelrc. Shouldn't invoking prettier with --write . suffice?

Failure Logs

[error] ENAMETOOLONG: name too long, stat '/Users/pedro/Developer/ide/**/*{.js,._js,.bones,.cjs,.es,.es6,.frag,.gs,.jake,.jsb,.jscad,.jsfl,.jsm,.jss,.mjs,.njs,.pac,.sjs,.ssjs,.xsjs,.xsjslib,.wxs,.js.flow,.jsx,.ts,.mts,.cts,.tsx,.json,.avsc,.geojson,.gltf,.har,.ice,.JSON-tmLanguage,.mcmeta,.tfstate,.tfstate.backup,.topojson,.webapp,.webmanifest,.yy,.yyp,.jsonc,.sublime-build,.sublime-commands,.sublime-completions,.sublime-keymap,.sublime-macro,.sublime-menu,.sublime-mousemap,.sublime-project,.sublime-settings,.sublime-theme,.sublime-workspace,.sublime_metrics,.sublime_session,.json5,.css,.wxss,.pcss,.postcss,.less,.scss,.handlebars,.hbs,.graphql,.gql,.graphqls,.md,.markdown,.mdown,.mdwn,.mkd,.mkdn,.mkdown,.ronn,.scd,.workbook,.mdx,.component.html,.html,.htm,.html.hl,.inc,.xht,.xhtml,.mjml,.vue,.yml,.mir,.reek,.rviz,.sublime-syntax,.syntax,.yaml,.yaml-tmlanguage,.yaml.sed,.yml.mysql,.xml,.adml,.admx,.ant,.axml,.builds,.ccproj,.ccxml,.clixml,.cproject,.cscfg,.csdef,.csl,.csproj,.ct,.depproj,.dita,.ditamap,.ditaval,.dll.config,.dotsettings,.filters,.fsproj,.fxml,.glade,.gml,.gmx,.grxml,.iml,.inx,.ivy,.jelly,.jsproj,.kml,.launch,.mdpolicy,.mjml,.mm,.mod,.mxml,.natvis,.ncl,.ndproj,.nproj,.nuspec,.odd,.osm,.pkgproj,.pluginspec,.proj,.props,.ps1xml,.psc1,.pt,.rdf,.resx,.rss,.sch,.scxml,.sfproj,.shproj,.srdf,.storyboard,.sublime-snippet,.targets,.tml,.ts,.tsx,.ui,.urdf,.ux,.vbproj,.vcxproj,.vsixmanifest,.vssettings,.vstemplate,.vxml,.wixproj,.workflow,.wsdl,.wsf,.wxi,.wxl,.wxs,.x3d,.xacro,.xaml,.xib,.xlf,.xliff,.xmi,.xml.dist,.xproj,.xsd,.xsl,.xslt,.xspec,.xul,.zcml,.svg}'
nx format:write
Error: Command failed: node "/Users/pedro/Developer/ide/node_modules/prettier/bin-prettier.js" --write "**/*{.js,._js,.bones,.cjs,.es,.es6,.frag,.gs,.jake,.jsb,.jscad,.jsfl,.jsm,.jss,.mjs,.njs,.pac,.sjs,.ssjs,.xsjs,.xsjslib,.wxs,.js.flow,.jsx,.ts,.mts,.cts,.tsx,.json,.avsc,.geojson,.gltf,.har,.ice,.JSON-tmLanguage,.mcmeta,.tfstate,.tfstate.backup,.topojson,.webapp,.webmanifest,.yy,.yyp,.jsonc,.sublime-build,.sublime-commands,.sublime-completions,.sublime-keymap,.sublime-macro,.sublime-menu,.sublime-mousemap,.sublime-project,.sublime-settings,.sublime-theme,.sublime-workspace,.sublime_metrics,.sublime_session,.json5,.css,.wxss,.pcss,.postcss,.less,.scss,.handlebars,.hbs,.graphql,.gql,.graphqls,.md,.markdown,.mdown,.mdwn,.mkd,.mkdn,.mkdown,.ronn,.scd,.workbook,.mdx,.component.html,.html,.htm,.html.hl,.inc,.xht,.xhtml,.mjml,.vue,.yml,.mir,.reek,.rviz,.sublime-syntax,.syntax,.yaml,.yaml-tmlanguage,.yaml.sed,.yml.mysql,.xml,.adml,.admx,.ant,.axml,.builds,.ccproj,.ccxml,.clixml,.cproject,.cscfg,.csdef,.csl,.csproj,.ct,.depproj,.dita,.ditamap,.ditaval,.dll.config,.dotsettings,.filters,.fsproj,.fxml,.glade,.gml,.gmx,.grxml,.iml,.inx,.ivy,.jelly,.jsproj,.kml,.launch,.mdpolicy,.mjml,.mm,.mod,.mxml,.natvis,.ncl,.ndproj,.nproj,.nuspec,.odd,.osm,.pkgproj,.pluginspec,.proj,.props,.ps1xml,.psc1,.pt,.rdf,.resx,.rss,.sch,.scxml,.sfproj,.shproj,.srdf,.storyboard,.sublime-snippet,.targets,.tml,.ts,.tsx,.ui,.urdf,.ux,.vbproj,.vcxproj,.vsixmanifest,.vssettings,.vstemplate,.vxml,.wixproj,.workflow,.wsdl,.wsf,.wxi,.wxl,.wxs,.x3d,.xacro,.xaml,.xib,.xlf,.xliff,.xmi,.xml.dist,.xproj,.xsd,.xsl,.xslt,.xspec,.xul,.zcml,.svg}"
    at checkExecSyncError (node:child_process:826:11)
    at execSync (node:child_process:900:15)
    at write (/Users/pedro/Developer/ide/node_modules/@nrwl/workspace/src/command-line/format.js:109:38)
    at /Users/pedro/Developer/ide/node_modules/@nrwl/workspace/src/command-line/format.js:35:46
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (/Users/pedro/Developer/ide/node_modules/@nrwl/workspace/src/command-line/format.js:35:27)
    at Generator.next (<anonymous>)
    at fulfilled (/Users/pedro/Developer/ide/node_modules/tslib/tslib.js:114:62) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 42227,
  stdout: null,
  stderr: null
}

Environment

 Node : 17.3.0
  OS   : darwin arm64
  npm  : 8.3.0

  nx : 13.4.1
  @nrwl/angular : undefined
  @nrwl/cli : 13.4.1
  @nrwl/cypress : 13.4.1
  @nrwl/devkit : 13.4.1
  @nrwl/eslint-plugin-nx : 13.4.1
  @nrwl/express : undefined
  @nrwl/jest : 13.4.1
  @nrwl/linter : 13.4.1
  @nrwl/nest : undefined
  @nrwl/next : undefined
  @nrwl/node : undefined
  @nrwl/nx-cloud : undefined
  @nrwl/react : 13.4.1
  @nrwl/react-native : undefined
  @nrwl/schematics : undefined
  @nrwl/tao : 13.4.1
  @nrwl/web : 13.4.1
  @nrwl/workspace : 13.4.1
  @nrwl/storybook : 13.4.1
  @nrwl/gatsby : undefined
  typescript : 4.5.4
  rxjs : 7.5.1
  ---------------------------------------
  Community plugins:
         @nrwl/js: 13.4.1
         @nx-dotnet/core: 1.8.0
cjdm94 commented 2 years ago

I'm experiencing the same issue. Environment:

  Node : 14.18.1
  OS   : darwin x64
  npm  : 8.1.3

  nx : 13.3.8
  @nrwl/angular : undefined
  @nrwl/cli : 13.3.8
  @nrwl/cypress : undefined
  @nrwl/devkit : 13.4.2
  @nrwl/eslint-plugin-nx : undefined
  @nrwl/express : undefined
  @nrwl/jest : 13.4.2
  @nrwl/linter : 13.4.2
  @nrwl/nest : undefined
  @nrwl/next : undefined
  @nrwl/node : undefined
  @nrwl/nx-cloud : 13.0.1
  @nrwl/react : undefined
  @nrwl/react-native : undefined
  @nrwl/schematics : undefined
  @nrwl/tao : 13.3.8
  @nrwl/web : undefined
  @nrwl/workspace : 13.3.8
  @nrwl/storybook : undefined
  @nrwl/gatsby : undefined
  typescript : 4.5.4
  rxjs : 6.6.7
  ---------------------------------------
  Community plugins:
chrisui commented 2 years ago

+1

>  NX   WARNING  Running affected:* commands with --all can result in very slow builds.

  --all is not meant to be used for any sizable project or to be used in CI.

  Learn more about checking only what is affected: https://nx.dev/latest/angular/cli/affected#affected.

[error] ENAMETOOLONG: name too long, stat '/Users/chrispearce/Projects/seed/**/*{.js,._js,.bones,.cjs,.es,.es6,.frag,.gs,.jake,.jsb,.jscad,.jsfl,.jsm,.jss,.mjs,.njs,.pac,.sjs,.ssjs,.xsjs,.xsjslib,.wxs,.js.flow,.jsx,.ts,.mts,.cts,.tsx,.json,.avsc,.geojson,.gltf,.har,.ice,.JSON-tmLanguage,.mcmeta,.tfstate,.tfstate.backup,.topojson,.webapp,.webmanifest,.yy,.yyp,.jsonc,.sublime-build,.sublime-commands,.sublime-completions,.sublime-keymap,.sublime-macro,.sublime-menu,.sublime-mousemap,.sublime-project,.sublime-settings,.sublime-theme,.sublime-workspace,.sublime_metrics,.sublime_session,.json5,.css,.wxss,.pcss,.postcss,.less,.scss,.handlebars,.hbs,.graphql,.gql,.graphqls,.md,.markdown,.mdown,.mdwn,.mkd,.mkdn,.mkdown,.ronn,.scd,.workbook,.mdx,.component.html,.html,.htm,.html.hl,.inc,.xht,.xhtml,.mjml,.vue,.yml,.mir,.reek,.rviz,.sublime-syntax,.syntax,.yaml,.yaml-tmlanguage,.yaml.sed,.yml.mysql,.js,._js,.bones,.cjs,.es,.es6,.frag,.gs,.jake,.jsb,.jscad,.jsfl,.jsm,.jss,.mjs,.njs,.pac,.sjs,.ssjs,.xsjs,.xsjslib,.wxs,.js.flow,.jsx,.ts,.mts,.cts,.tsx,.md,.markdown,.mdown,.mdwn,.mkd,.mkdn,.mkdown,.ronn,.scd,.workbook,.mdx}'
failed formatting
chrispearce@Chriss-MacBook-Pro seed % npx nx report  

>  NX  Report complete - copy this into the issue template

  Node : 14.18.1
  OS   : darwin arm64
  npm  : 8.1.3

  nx : 13.3.8
  @nrwl/angular : undefined
  @nrwl/cli : 13.3.8
  @nrwl/cypress : undefined
  @nrwl/devkit : 13.4.2
  @nrwl/eslint-plugin-nx : undefined
  @nrwl/express : undefined
  @nrwl/jest : 13.4.2
  @nrwl/linter : 13.4.2
  @nrwl/nest : undefined
  @nrwl/next : undefined
  @nrwl/node : undefined
  @nrwl/nx-cloud : 13.0.1
  @nrwl/react : undefined
  @nrwl/react-native : undefined
  @nrwl/schematics : undefined
  @nrwl/tao : 13.3.8
  @nrwl/web : undefined
  @nrwl/workspace : 13.3.8
  @nrwl/storybook : undefined
  @nrwl/gatsby : undefined
  typescript : 4.5.4
  rxjs : 6.6.7
  ---------------------------------------
  Community plugins:
chrisui commented 2 years ago

Can workaround by always using --affected.

github-actions[bot] commented 1 year ago

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.