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

Error "found orphan CR, try removeCR option" on windows #194

Closed msmaximuss closed 3 years ago

msmaximuss commented 3 years ago

When build Angular 10 project with default (Win10) CRLF configuration got error:

Error: resolve-url-loader: CSS error source-map information is not available at url() declaration (found orphan CR, try removeCR option)

Should it not depend on line endings? It's weird to change line endings for particular file types.

bholloway commented 3 years ago

The full detail on this problem is in the troubleshooting docs.

ultimately this is an upstream problem that we need to workaround.

shaurcasm commented 3 years ago

Hi, I have the same issue. I'm using Create-react-app but, I can't eject and risk breaking the rest of the work till now.

Is there any work around to setting the removeCR options without webpack.config file? or any other way to fix without react-script ejection?

Sorry for the troubles.

bholloway commented 3 years ago

@shaurcasm I'm open to suggestions on how we deal with this.

Ultimately this is an upstream problem and I'd prefer that its fixed in libsass but its not something I have time to raise with them. In which case it might be simpler to just make it default for windows.

Do you have any other suggestions how to deal with this? Does CRA not allow some custom tweaks to loaders, I will have to take a look.

shaurcasm commented 3 years ago

@shaurcasm I'm open to suggestions on how we deal with this.

Ultimately this is an upstream problem and I'd prefer that its fixed in libsass but its not something I have time to raise with them. In which case it might be simpler to just make it default for windows.

Do you have any other suggestions how to deal with this? Does CRA not allow some custom tweaks to loaders, I will have to take a look.

That's reasonable. I fixed it by moving to Ubuntu, so it's not too bad. Yes, I think making it default for Windows, if possible, would be a good stop gap solution.

CRA does allow to make tweaks, but that needs ejecting the project. And that usually can lead to disrupting the app if its well into its development. So, its a very niche case. Starting a new project and making those webpack changes shouldn't be an issue.

I'm sorry, i don't have an alternate solution. The proposal seems like a good way to go till the libsass fix.

bholloway commented 3 years ago

Published resolve-url-loader@4.0.0-beta.2 as tag next. 🎉

@shaurcasm lets continue any discussion on #195 even though it is closed.

danielvoigt commented 1 year ago

@bholloway That troubleshooting doc you referenced doesn't exist anymore