Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Absolute and tilde paths doesn't work #1236

Closed
vyorkin opened this issue Apr 23, 2018 · 15 comments
Closed

Absolute and tilde paths doesn't work #1236

vyorkin opened this issue Apr 23, 2018 · 15 comments

Comments

@vyorkin
Copy link

vyorkin commented Apr 23, 2018

Related: #850 (comment)

For example this:

require('/assets/logo.png')
parcel index.html -p 3101

installs the "assets" package for me :)

@DeMoorJasper
Copy link
Member

DeMoorJasper commented Apr 24, 2018

Disable autoinstall this should throw the correct error u encounter, using --no-autoinstall

Sent with GitHawk

@vyorkin
Copy link
Author

vyorkin commented Apr 24, 2018

I've just tried with --no-autoinstall, it doesn't attempt to install the assets package anymore and I can see there is path to image in the output html http://localhost:3101/logo.png, but it isn't served by the parcel – 404 Not Found

@DeMoorJasper
Copy link
Member

That's strange is the file being created in the dist directory?

@vyorkin
Copy link
Author

vyorkin commented Apr 24, 2018

no it isn't, just checked,
maybe I should provide a "minimal reproducible repo" and then open a new issue?

@DeMoorJasper
Copy link
Member

You can comment the repo here, no need to open a new issue

@DeMoorJasper
Copy link
Member

Closing due to inactivity and autoinstall has been fixed

@marcosbozzani
Copy link
Contributor

marcosbozzani commented May 8, 2018

I have the same problem.

Minimal reproducible repo: https://github.com/marcosbozzani/parcel-bug-tilde-abs-paths

Just clone the repo, yarn install and yarn tilde or yarn slash

Tilde error: Cannot resolve dependency './~\style.css'
Slash error: Cannot resolve dependency './..\..\..\..\..\..\

For now, I've patched Asset.js and works for me.

I've also created created a PR with tests: #1324

Software Version(s)
Parcel parcel 1.8.1
Node node v8.9.4
npm/Yarn yarn 1.6.0
Operating System windows 10 1703

@houd1ni
Copy link

houd1ni commented May 16, 2018

Me too. With ubuntu 18.04, npm 6 and node 9.

The only difference that I use vuejs. And am trying to resolve import something from '~/foo/bar' in /abspath/hello.vue.

It simply puts the tilde to the relative path like this: 'cannot resolve in /abspath/~/foo/bar.js'.

The very similar trouble with paths, that begin with a slash.

@DeMoorJasper DeMoorJasper reopened this May 16, 2018
@houd1ni
Copy link

houd1ni commented May 23, 2018

is it really a question or a bug? I've done nothing but using a plain parcel to reproduce this in two projects. I even guess, that others just don't use these aliases at all.

@barneycarroll
Copy link

@houd1ni it's a verified bug, fixed in #1324. It'll be part of the 1.9 release.

@barneycarroll
Copy link

@DeMoorJasper can we keep this open until the fix is released? I've found tracking this problem really difficult because according to all records it has been a feature for ages, with all associated bug reports / feature requests closed, which gives the misleading impression that it should be usable now.

@viztor
Copy link

viztor commented Jul 30, 2018

It doesn't seems the issue is fixed in the latest release

@viztor
Copy link

viztor commented Jul 30, 2018

@DeMoorJasper please reopen. this is not fixed. it is horrible looking through all the internet for a solution, and found several times it being mentioned as fixed, then after several times recognizing this as my problem, realizing this was never fixed properly in the first place.

@julianeden
Copy link

This is still not working. Was Parcel 1 abandoned in favor of Parcel 2 development 2 years ago?

@houd1ni
Copy link

houd1ni commented Oct 8, 2020

@julianeden looks like parcel's issues have been abandoned years ago (:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants