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

Regression in 0.3.0 #32

Closed
appsforartists opened this issue Nov 12, 2014 · 8 comments
Closed

Regression in 0.3.0 #32

appsforartists opened this issue Nov 12, 2014 · 8 comments

Comments

@appsforartists
Copy link

I just tried upgrading to 0.3.0 and got this error in code that works in 0.2.0:

./~/css-loader!./~/autoprefixer-loader!./~/sass-loader!./application/styles.scss
Module build failed: TypeError: undefined is not a function
    at resolveSassPath (node_modules/sass-loader/node_modules/sass-graph/sass-graph.js:24:23)
    at Graph.addFile (node_modules/sass-loader/node_modules/sass-graph/sass-graph.js:66:20)
    at Graph.addFile (node_modules/sass-loader/node_modules/sass-graph/sass-graph.js:72:12)
    at Graph.addFile (node_modules/sass-loader/node_modules/sass-graph/sass-graph.js:72:12)
    at Object.module.exports.parseFile (node_modules/sass-loader/node_modules/sass-graph/sass-graph.js:122:9)
    at Object.module.exports (node_modules/sass-loader/index.js:33:27)
 @ ./application/styles.scss 3:1-339 8:9-347
@akiran
Copy link
Contributor

akiran commented Nov 12, 2014

@appsforartists
I am trying to debug this issue
Can you post the format of your import statements ?

@waldreiter
Copy link

I guess there are lots of imports that break.

We have in production a src/_vars.scss that gets included from src/components/List.scss
with the path from the project root:

@import "src/vars.scss";

Another import that crashes in 0.3.0 is:

@import "a.scss", "b.scss";

The last example compiles fine, but it won't get found by sass-graph, because of an extra space:

@import  "a.scss";

@akiran
Copy link
Contributor

akiran commented Nov 12, 2014

I fixed sass-graph and sass-loader to support different formats of importing
Try this https://github.com/akiran/sass-loader.git by installing from git and let me know if it works for you

@waldreiter
Copy link

@akiran That was fast. 😃 I have only checked my first example, because this is what we actually use. But it still does not work. It seem like adding this.options.context to loadPathsfixes this case. I wonder why it works with node-sass?

@akiran
Copy link
Contributor

akiran commented Nov 13, 2014

@cody
Can you point me the code snippet of your fix ?

In your first example, you are using absolute paths. You have to add src directory in include paths of webpack config file or use relative paths.
loader: "style!css!sass?includePaths[]=" + srcPath

I tested with different formats of imports
https://github.com/akiran/sass-graph/blob/master/test/test.parse-imports.js
You other examples are taken care in these testcases.

@waldreiter
Copy link

@akiran That works. 👍

Just the error message that was given shoud be improved. I got this:

/app/node_modules/sass-loader/node_modules/sass-graph/sass-graph.js:26
  throw "Failed to resolve " + path + " in [" + loadPaths + "]";
                                                          ^
Failed to resolve [object Object] in [/app/src,,/app/src]

@appsforartists Can you check if your bug is fixed too?

@akiran
Copy link
Contributor

akiran commented Nov 17, 2014

This issue is fixed in sass-loader 0.3.1

@akiran akiran closed this as completed Nov 17, 2014
@appsforartists
Copy link
Author

I was able to upgrade to 0.3.1, though I also had to explicitly install node-sass 1.2.2. 1.2.3 throws a "module did not self-register".

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

3 participants