Skip to content
This repository has been archived by the owner on Oct 16, 2020. It is now read-only.

'%' in paths causes error #660

Open
martinheidegger opened this issue Jan 9, 2020 · 0 comments
Open

'%' in paths causes error #660

martinheidegger opened this issue Jan 9, 2020 · 0 comments

Comments

@martinheidegger
Copy link

When #228 introduced for path normalization ( @%40 ) this block of code was added:

const pathParts = parts.pathname.split('/').map(segment => encodeURIComponent(decodeURIComponent(segment)))

Unfortunately decodeURIComponent doesn't work if the path looks something like

.../node_modules/@expo/traveling-fastlane-darwin/traveling-fastlane-1.11.3-osx/lib/vendor/ruby/2.2.0/gems/fastlane-2.136.0/fastlane/lib/fastlane/plugins/template/%gem_name%.gemspec.erb

and causes following error:

URIError: URI malformed
    at decodeURIComponent (<anonymous>)
    at /Users/m/.vscode/extensions/sourcegraph.javascript-typescript-0.0.7/node_modules/javascript-typescript-langserver/lib/util.js:46:83
    at Array.map (<anonymous>)
    at Object.normalizeUri (/Users/m/.vscode/extensions/sourcegraph.javascript-typescript-0.0.7/node_modules/javascript-typescript-langserver/lib/util.js:46:49)
    at Glob.<anonymous> (/Users/m/.vscode/extensions/sourcegraph.javascript-typescript-0.0.7/node_modules/javascript-typescript-langserver/lib/fs.js:62:40)
    at Glob.emit (events.js:200:13)
    at Glob._emitMatch (/Users/m/.vscode/extensions/sourcegraph.javascript-typescript-0.0.7/node_modules/glob/glob.js:489:8)
    at Glob._processSimple2 (/Users/m/.vscode/extensions/sourcegraph.javascript-typescript-0.0.7/node_modules/glob/glob.js:705:8)
    at /Users/m/.vscode/extensions/sourcegraph.javascript-typescript-0.0.7/node_modules/glob/glob.js:676:10
    at Glob._stat2 (/Users/m/.vscode/extensions/sourcegraph.javascript-typescript-0.0.7/node_modules/glob/glob.js:789:10)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant