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.

ENOENT: no such file or directory, lstat with # encoded in filename

See original GitHub issue

#8928 actually resolved the issue #8907 I open couple days ago. However, when filenames contain an encoded # character (%23), current decoding process do not handled it.

Configuration:

  • Web browser and its version: Electron 1.7.8
  • Operating system and its version: Fedora 25
  • PDF.js version: 1.9.617

Steps to reproduce the problem:

  1. Open a locale file with an # encoded character file:///home/njakob/Foo%20Bar/document%23.pdf

What went wrong?

  • The error ENOENT: no such file or directory, lstat is raised.

Issue is related to the decodeURI usage which ignore decoding of %23.

Solution should also cover cases were the # is inside the path such as file:///home/njakob/Foo%23/document.pdf.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
mukulmishra18commented, Jan 15, 2018

If you try to decode any url that contains %23 in it, using decodeURIComponent then it will decode just fine. So I think this should solve the problem.

Also note that you are using chrome extension, so node_stream was never used, because it is intended to use in node environment. I will suggest to create a node app that uses pdf.js and see if problem still persists.

Edit: I would suggest to use console.log as much as you can to see if code really executing.

0reactions
shikhar-scscommented, Jan 15, 2018

Also note that you are using chrome extension, so node_stream was never used, because it is intended to use in node environment. I will suggest to create a node app that uses pdf.js and see if problem still persists.

Thank you so much for this information and also for your help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to resolve Nodejs: Error: ENOENT: no such file or directory
Your app is expecting to find a file at /home/embah/node/nodeapp/config/config.json but that file does not exist (which is what ENOENT ...
Read more >
File system | Node.js v19.3.0 Documentation
Using fsPromises.rmdir() on a file (not a directory) results in the promise being rejected with an ENOENT error on Windows and an ENOTDIR...
Read more >
How To Fix the “Enoent” Error? - Position Is Everything
The “enoent” can appear because of some missing files or usage of the relative path that can be solved by creating an expected...
Read more >
File — Elixir v1.12.3 - HexDocs
Creates a symbolic link new to the file or directory existing . ... of the file name is not a directory; on some...
Read more >
Does stat/lstat on nonexistent file cause a disk seek?
Somehow the OS needs the information, wether the file is there or not. Obviously it has to read in the folder list of...
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