question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ENAMETOOLONG: name too long, open...

See original GitHub issue
  • Issue

We have an angular 2 project which includes a component lib in the node_modules folder, which must be complied by jest since it is shipped with .ts files. This results in very long file names like this one:

/Users/wayne/web/myProject-newAmazingApp-ui/node_modules/myProject-components-ui/src/lib/components/container/my-dialog-edit-select-box/my-edit-select-box-item/my-edit-select-box-item.component.html

When running jest I receive the following error:

ENAMETOOLONG: name too long, open '/var/folders/lr/dg7jdw9n2f7d8j1pns2drsfr0000gn/T/jest/ts-jest/L1VzZXJzL3BpdHRpL3dlYi91bHBpYW4tZmFsbGJlYXJiZWl0dW5nLXVpL25vZGVfbW9kdWxlcy91bHBpYW4tY29tcG9uZW50cy11aS9zcmMvbGliL2NvbXBvbmVudHMvY29udGFpbmVyL3VsLWRpYWxvZy1lZGl0LXNlbGVjdC1ib3gvdWwtZWRpdC1zZWxlY3QtYm94LWl0ZW0vdWwtZWRpdC1zZWxlY3QtYm94LWl0ZW0uY29tcG9uZW50LnRz'
      
      at Object.fs.openSync (fs.js:584:18)
      at Object.fs.writeFileSync (fs.js:1316:33)
      at process (node_modules/ts-jest/dist/preprocessor.js:25:16)
      at Object.module.exports.process (node_modules/jest-preset-angular/preprocessor.js:12:10)
  • Expected behavior

It should work.

I have already created a pull request (https://github.com/kulshekhar/ts-jest/pull/152) which uses a hash instead of a Buffer to create the files names for the cache. The problem is that the code coverage processor must encrypt the cached files names to generate the report. This is not possible with a hash. And I have not found a solution so far to encrypt the filename with a fixed length.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:14 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
abderrahmen13commented, Aug 4, 2020

try to add “data:image/png;base64,” before name of file exemple: data:image/png;base64,L1VzZXJzL3BpdHRpL3dlYi91bHBpYW4tZmFsbGJlYXJiZWl0dW5nLXVpL25vZGVfbW9kdWxlcy91bHBpYW4tY29tcG9uZW50cy11aS9zcmMvbGliL2NvbXBvbmVudHMvY29udGFpbmVyL3VsLWRpYWxvZy1lZGl0LXNlbGVjdC1ib3gvdWwtZWRpdC1zZWxlY3QtYm94LWl0ZW0vdWwtZWRpdC1zZWxlY3QtYm94LWl0ZW0uY29tcG9uZW50LnRz

0reactions
kulshekharcommented, Apr 13, 2017

@kryops once the feedback on that PR is incorporated, I’ll merge it

Read more comments on GitHub >

github_iconTop Results From Across the Web

Strapi >>> Facing "ENAMETOOLONG: name too long" error
When I try to upload a file with long name then I'm getting below error: error: ENAMETOOLONG: name too long. File name: Lorem...
Read more >
[SOLVED] ENAMETOOLONG: File name too long [rename]
ENAMETOOLONG : File name too long [rename]. OS is Linux Full path to archive is 220 characters, archive filename with extension is 184 ......
Read more >
NodeJS create Raster with DataURL - name too long error
Tried to open a new Issue with this but GitHub just reloads the same new issue page when I ... Error: ENAMETOOLONG, name...
Read more >
Facing "ENAMETOOLONG: name too long" error
There is no specific reason for that but client faced this issue with long name and raised bug over the internal platform. I...
Read more >
Upload Image Fail: [Error: ENAMETOOLONG: name too long
Upload Image Fail: [Error: ENAMETOOLONG: name too long,. Follow. Avatar. linleiqin. 5 months ago. data:image/svg+xml;utf8,<svg ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found