Cannot resolve dependency './../../../../../../../../../..' at '/'
See original GitHub issue.babelrc
{
"presets": [
"env",
"stage-0"
]
}
package.json
"devDependencies": {
"babel-preset-env": "1.6.1",
"babel-preset-stage-0": "6.24.1",
"parcel-bundler": "1.4.1"
},
"scripts": {
"start": "parcel -p 3000 ./app/index.html"
}
failed when app/index.html contains non # hrefs, like
<nav>
<div class="grid-header nav-wrapper blue-grey lighten-1">
<a href="/" class="brand-logo"> Knockout.js</a>
<a href="/" data-activates="mobile-menu" class="button-collapse">
<i class="material-icons">menu</i>
</a>
<ul class="right hide-on-med-and-down">
<li><a href="/">Home</a></li>
<li><a href="/link1">Link 1</a></li>
<li><a href="/link2">Link 2</a></li>
</ul>
<ul class="side-nav" id="mobile-menu">
<li><a href="/">Home</a></li>
<li><a href="/link1">Login</a></li>
<li><a href="/link2">Logout</a></li>
</ul>
</div>
</nav>
error if index.html page contains <a href="/" ...>...</a>
:
yarn start
yarn run v1.3.2
$ parcel -p 3000 ./app/index.html
Server running at http://localhost:3000
🚨 /Users/mak/Documents/code/test/js/knockout/knockout-examples/computed/app/index.html: Cannot resolve dependency './../../../../../../../../../..' at '/'
at /Users/mak/Documents/code/test/js/knockout/knockout-examples/computed/node_modules/browser-resolve/node_modules/resolve/lib/async.js:55:21
at load (/Users/mak/Documents/code/test/js/knockout/knockout-examples/computed/node_modules/browser-resolve/node_modules/resolve/lib/async.js:69:43)
at onex (/Users/mak/Documents/code/test/js/knockout/knockout-examples/computed/node_modules/browser-resolve/node_modules/resolve/lib/async.js:92:31)
at /Users/mak/Documents/code/test/js/knockout/knockout-examples/computed/node_modules/browser-resolve/node_modules/resolve/lib/async.js:22:47
at FSReqWrap.oncomplete (fs.js:166:21)
other info
yarn -v
1.3.2
node -v
v9.4.0
npm -v
5.6.0
uname -a
Darwin kostromin-mb.local 17.3.0 Darwin Kernel Version 17.3.0: Thu Nov 9 18:09:22 PST 2017; root:xnu-4570.31.3~1/RELEASE_X86_64 x86_64
note: build works fine if replace all href="/.."
to href="#/..."
Regards, Maksim
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Cannot resolve dependency, but file exists #1986 - GitHub
i don't understand why pacel could not resolve a dependency. when i run parcel build index.html i get the error. /Users/tim/proj_/parcel-example ...
Read more >reactjs - "Cannot resolve dependency" when importing local ...
I get Cannot resolve dependency 'f-app-hub' during build. However, VS Code shows no errors and is able to correctly identify and source ...
Read more >Sync: Resolve dependencies > Cannot resolve [maven ...
1. Run java maven project (with maven dependencies from the private repository) within the IDEA. · 2. Maven configuration has password protected repositories ......
Read more >Cannot Resolve Dependency to Assembly Error Occurs
Description. An error that the dependency to a Telerik assembly cannot be resolved occurs. Error Message. Cannot resolve dependency to assembly 'Telerik.
Read more >'Cannot resolve dependency to assembly 'PostSharp, Version ...
In short, this is known issue with XAML compiler, where it tries to load assemblies referenced by your dependencies and generates the mentioned...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
✨ It seems like parcel (1.5.0) has fixed this, here it is:
🚨 Here is what i think, maybe not correct. In parcel (1.4.1), HTMLAsset may mistake virtual path for a dependency,
https://github.com/parcel-bundler/parcel/blob/68258b1e53d086f173d2888d9fa367fcba891807/src/assets/HTMLAsset.js#L42-L54
but in fact, this ‘dependency’ is not ‘illegal’, then it
console.error('Cannot resolve dependency')
So, if add this:
a[href='/']
can temporary work fine.Example:
Before:
After:
As for
a[href='#']
,isUrl
has filtered it:https://github.com/parcel-bundler/parcel/blob/68258b1e53d086f173d2888d9fa367fcba891807/src/assets/HTMLAsset.js#L47-L49
https://github.com/parcel-bundler/parcel/blob/68258b1e53d086f173d2888d9fa367fcba891807/src/utils/is-url.js#L3-L4
https://github.com/parcel-bundler/parcel/blob/68258b1e53d086f173d2888d9fa367fcba891807/src/utils/is-url.js#L8-L11
I’m sorry that my english isn’t good. 😭
Hello again,
I can confirm that 1.5.1 fixed my issue.
Thank you!
PS: @marcuslindfeldt I will close this, but if you still have trouble, probably it would be better to create new issue.
Regards, Maksim