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

return path.charAt(0) === '/'; - TypeError: Cannot read property 'charAt' of undefined #156

Closed
ChrisCinelli opened this issue Sep 11, 2015 · 1 comment

Comments

@ChrisCinelli
Copy link

We had a this error:

  build
  clean
  copy
  build/package.json
  bundle
  path.js:479
   return path.charAt(0) === '/';
              ^
  TypeError: Cannot read property 'charAt' of undefined
     at Object.posix.isAbsolute (path.js:479:14)
     at Object.posix.normalize (path.js:461:26)
     at formatSassError (/myproduct/node_modules/sass-loader/index.js:55:25)
     at Object.onRender (/myproduct/node_modules/sass-loader/index.js:251:13)
     at /myproduct/node_modules/sass-loader/node_modules/async/lib/async.js:868:35
     at _arrayEach (/myproduct/node_modules/sass-loader/node_modules/async/lib/async.js:91:13)
     at Object.<anonymous> (/myproduct/node_modules/sass-loader/node_modules/async/lib/async.js:867:17)
     at Object.callback (/myproduct/node_modules/sass-loader/node_modules/async/lib/async.js:44:16)
     at options.error (/myproduct/node_modules/node-sass/lib/index.js:279:32)

I think there are 2 bugs. One in sass-loader and another in node-sass.

The problem is that err was an Unknown error.

You may want to at least add a if(err.file) ... before this line https://github.com/jtangelder/sass-loader/blob/74deeb794c1bac6ce5d1f85f6dcbfd7d1a010e53/index.js#L55
But you may just saying that Unknown Error was received and "sorry we cannot give more explanations".

It looks like that node-sass compiler was hanging on _problematic_file.sass that was included in the base style.sass. This file was starting with:

    &
         color: #fff 
         ... 

It took a while to find the problem because no error was pointing to that file specifically.

@jorrit
Copy link
Contributor

jorrit commented Sep 11, 2015

Would #158 be a fix?

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

2 participants