bholloway / resolve-url-loader

Webpack loader that resolves relative paths in url() statements based on the original source file
563 stars 71 forks source link

defaultBasePath corrupted on windows #11

Closed bholloway closed 5 years ago

bholloway commented 8 years ago

Refer to late addition to #7.

Original comment by @meta-meta.

@bholloway I'm seeing this problem. following your advice

If you want to hack some code then try logging value at sources-relative-to-absolute.js#L67 and let me know what you get.

what would it mean if on line 75, adding

console.log(value);

produces

/
d:\

the root directory of my webpack project is d:\Projects/project I am running Windows and my colleagues running on Mac do not experience this issue.

I am running into this error only on webpack-dev-server. webpack works fine

update: I'm seeing defaultBasePath passed to sourcesRelativeToAbsolute(sources, defaultBasePath, limit) is / and I'm not sure why that is as the output.path in my webpack.config is pointing to d:\Projects\project\build

my dirty hack for now is to add this as first line of sourcesRelativeToAbolute: defaultBasePath = 'd:\\';

meta-meta commented 8 years ago

Thanks @bholloway

bholloway commented 8 years ago

@meta-meta I do not have experience with webpack-dev-server. How practical would it be for you to construct a small open-source repo that exhibits the problem?

I presume you are using SASS. So I suspect that the incoming source-map differs in this use case.

meta-meta commented 8 years ago

@bholloway I should be able to get to it sometime this weekend.

joshuacc commented 8 years ago

FWIW, I am seeing a similar warning on Windows when using webpack-dev-server, but no issues when running the normal webpack build.

bholloway commented 8 years ago

I don't like having this issue still open.

This not being my use-case it is a barrier to reproducing the issue. Until I can look at webpack-dev-server, or someone can give me a sample project that does, I am unable to move forward. Sorry I know that this is not a great answer.

bholloway commented 8 years ago

@cevou I noticed in your recent comment that you are using webpack-dev-server.

Can you add any insight to this issue? Seems to be only on windows so you may not have encountered it.

cevou commented 8 years ago

From the messages above I don't really get the use case. Is there some repo with which the error can be reproduced? I'm also using Windows, so I can check on it. @meta-meta does this problem still exist?

bholloway commented 5 years ago

I'm going to close this issue from inactivity. If this is still a problem lets open a fresh issue.