Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Fix Uncaught Error: ENOENT: no such file or directory #1358

Merged
merged 1 commit into from
Sep 14, 2020
Merged

Conversation

sadick254
Copy link
Contributor

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions

Description of the Change

Use JSON.stringify and JSON.parse since setting initialPaths using
e.dataTransfer.setData sets the array value to a DOMString.

Splitting the initialPaths on , fails if the root directory has a ',' as part of its name.

Relevant links

Alternate Designs

We could split initialPaths on ,/ but that would mean the items from index 1 onwards would have the incorrect path and we have to append / on every path.
consider

initialPaths = '/Users/home/some/file,/Users/home/some/anotherfile'
// If we split on './'
initialPaths = ['/Users/home/some/file', 'Users/home/some/anotherfile']

Benefits

Allow files to be moved to a root directory that has a ',' comma as part of its name

Possible Drawbacks

Not that i am aware of.

Applicable Issues

Resolves: #1357

Use JSON.stringify and JSON.parse since setting initialPaths using
e.dataTransfer.setData sets the array value to a DOMString.

Relevant links

https://developer.mozilla.org/en-US/docs/Web/API/DOMString
https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/setData
@sadick254 sadick254 self-assigned this Sep 14, 2020
@sadick254 sadick254 merged commit ec7e0f1 into master Sep 14, 2020
@sadick254 sadick254 deleted the fix-ENOENT branch September 14, 2020 19:24
This was referenced Sep 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Uncaught Error: ENOENT: no such file or directory, lstat '/ Inc'
1 participant