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

Refactoring a path with ".." in it causes an issue. #91

Closed
IngwiePhoenix opened this issue May 3, 2015 · 6 comments
Closed

Refactoring a path with ".." in it causes an issue. #91

IngwiePhoenix opened this issue May 3, 2015 · 6 comments

Comments

@IngwiePhoenix
Copy link

I am currently building a "custom" Bootstrap by going haywire with the config, and creating my own entry SCSS file. Truth be told, I am not familiar with SCSS. It's my first time of use.

I am getting this error:

    ERROR in ./~/css-loader?keepSpecialComments=0&processImport=true&rebase=true&relativeTo=/Users/Ingwie/Work/BIRD3&shorthandCompacting=true&target=/Users/Ingwie/Work/BIRD3/cdn/app!./~/sass-loader?includePaths[]=/Users/Ingwie/Work/BIRD3/bower_components/bootstrap-sass/assets/stylesheets&includePaths[]=/Users/Ingwie/Work/BIRD3/bower_components&includePaths[]=/Users/Ingwie/Work/BIRD3/node_modules&includePaths[]=/Users/Ingwie/Work/BIRD3/themes!./web-lib/bootstrapper.scss
    Module not found: Error: Cannot resolve 'file' or 'directory' ../fonts/glyphicons-halflings-regular.ttf in /Users/Ingwie/Work/BIRD3/web-lib
    resolve file
      /Users/Ingwie/Work/BIRD3/fonts/glyphicons-halflings-regular.ttf doesn't exist
      /Users/Ingwie/Work/BIRD3/fonts/glyphicons-halflings-regular.ttf.js doesn't exist
      /Users/Ingwie/Work/BIRD3/fonts/glyphicons-halflings-regular.ttf.json doesn't exist
      /Users/Ingwie/Work/BIRD3/fonts/glyphicons-halflings-regular.ttf.oj doesn't exist
    resolve directory
      /Users/Ingwie/Work/BIRD3/fonts/glyphicons-halflings-regular.ttf/package.json doesn't exist (directory description file)
      /Users/Ingwie/Work/BIRD3/fonts/glyphicons-halflings-regular.ttf doesn't exist (directory default file)
    [/Users/Ingwie/Work/BIRD3/fonts/glyphicons-halflings-regular.ttf]
    [/Users/Ingwie/Work/BIRD3/fonts/glyphicons-halflings-regular.ttf.js]
    [/Users/Ingwie/Work/BIRD3/fonts/glyphicons-halflings-regular.ttf.json]
    [/Users/Ingwie/Work/BIRD3/fonts/glyphicons-halflings-regular.ttf.oj]
     @ ./~/css-loader?keepSpecialComments=0&processImport=true&rebase=true&relativeTo=/Users/Ingwie/Work/BIRD3&shorthandCompacting=true&target=/Users/Ingwie/Work/BIRD3/cdn/app!./~/sass-loader?includePaths[]=/Users/Ingwie/Work/BIRD3/bower_components/bootstrap-sass/assets/stylesheets&includePaths[]=/Users/Ingwie/Work/BIRD3/bower_components&includePaths[]=/Users/Ingwie/Work/BIRD3/node_modules&includePaths[]=/Users/Ingwie/Work/BIRD3/themes!./web-lib/bootstrapper.scss 3:3646-3698

In Bootstrap's gylphcons.scss file, they refference the font files with "../glyphs.svg", for instance. Using the plain CSS version let's this work and resolve. But it appears that this module doesn't play nicely with this option.

For now I am commenting the glyphs out (I am using font-awesome too anyway) but would like to know if this could be resolved. Thanks!

@jhnns
Copy link
Member

jhnns commented May 6, 2015

All url()s must be relative to the sass main entry file, because the css-loader resolves the url()s based on this location.

Less has an option which rewrites the urls accordingly, but Sass has not afaik. Have you tried overriding the $icon-font-path instead?

@jsg2021
Copy link

jsg2021 commented May 18, 2015

Something is strange with '..' paths. I have a _fonts.scss as a sibling to my app.scss file, which imports that file. In my fonts file, I import several fonts in a parent-sibling path.

@import "../fonts/droid-serif/index.css";
@import "../fonts/open-sans/index.css";
...

once i work around #98 , i get:

ERROR in ./~/css-loader!./~/sass-loader?includePaths[]=/Users/jgrimes/Workspace/nti.web.mobile/src/main/resources/vendor/foundation/scss!./src/main/resources/scss/app.scss
Module build failed: 
@import "../fonts/droid-serif/index.css";
       ^
      File to import not found or unreadable: ../fonts/droid-serif/_index.css.scss/Users/jgrimes/Workspace/nti.web.mobile/src/main/resources/scss/
      in /Users/jgrimes/Workspace/nti.web.mobile/src/main/resources/scss/_fonts.scss (line 1, column 9)
Error: 
@import "../fonts/droid-serif/index.css";
       ^
      File to import not found or unreadable: ../fonts/droid-serif/_index.css.scss/Users/jgrimes/Workspace/nti.web.mobile/src/main/resources/scss/
      in /Users/jgrimes/Workspace/nti.web.mobile/src/main/resources/scss/_fonts.scss (line 1, column 9)
    at options.error (/Users/jgrimes/Workspace/nti.web.mobile/node_modules/node-sass/lib/index.js:276:32)
 @ ./src/main/resources/scss/app.scss 4:14-229

(this works just fine in 0.4.x)

@jhnns
Copy link
Member

jhnns commented May 20, 2015

Oops, that's probably a bug introduced with 1.0.2. We have to take care of .css file extensions

@skovhus
Copy link

skovhus commented Jun 30, 2015

It works in 1.0.0, but not in 1.0.1 and 1.0.2.

@jorrit
Copy link
Contributor

jorrit commented Jul 29, 2015

Does it work in 1.0.3?

@jhnns
Copy link
Member

jhnns commented Aug 6, 2015

Should be fixed with 2.0.0

@jhnns jhnns closed this as completed Aug 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants