-
Notifications
You must be signed in to change notification settings - Fork 60
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
Add a way to list discovered modules for debugging purposes #66
Comments
Added thought: debug output for known functions and Sass paths per named Eyeglass module would be good, something like: "modules": {
"eyeglass-sample": {
"version": "0.0.3",
"sasspath": "node_modules/eyeglass_example/sass",
"functions": [
"hello($name)"
]
},
"susy": {
"version": "2.2.6",
"sasspath": "node_modules/susy/sass"
}
} |
Also adding what I noted on Twitter: the inspiration here was that the libsass compiler's import error, which lists the load paths it tried, didn't include any of the paths to Eyeglass modules. More / original tweets here: https://twitter.com/jkohlmann/status/649359893682606080 |
eyeglass should output an error when it can't find a module / import path. This error will look something like... Error: src/scss/main.scss
1:9 Could not import foo from any of the following locations:
/Users/eoneill/workspace/eyeglass-test/src/scss/foo
/Users/eoneill/workspace/eyeglass-test/src/scss/foo.scss
/Users/eoneill/workspace/eyeglass-test/src/scss/foo/index.scss
/Users/eoneill/workspace/eyeglass-test/src/scss/foo.sass
/Users/eoneill/workspace/eyeglass-test/src/scss/foo/index.sass
/Users/eoneill/workspace/eyeglass-test/src/scss/foo.css
/Users/eoneill/workspace/eyeglass-test/src/scss/foo/index.css
/Users/eoneill/workspace/eyeglass-test/src/scss/_foo.scss
/Users/eoneill/workspace/eyeglass-test/src/scss/foo/_index.scss
/Users/eoneill/workspace/eyeglass-test/src/scss/_foo.sass
/Users/eoneill/workspace/eyeglass-test/src/scss/foo/_index.sass
/Users/eoneill/workspace/eyeglass-test/src/scss/_foo.css
/Users/eoneill/workspace/eyeglass-test/src/scss/foo/_index.css
... That said, the importer is somewhat fragile and has to know the file origin (path on disk) to correctly resolve the imports. Depending on your build pipeline, this information isn't always made available to eyeglass and can cause useless and misguiding errors (like There's also a bug in eyeglass' import-once logic that can cause this odd behavior and again results in a useless / misguiding error message. See #65 That said, I still like the idea of getting debugging information as this can be quite confusing at times :) |
I think I might have fixed the case where imports fail silently in my latest commit: 897b33e#diff-a1fa89b3186a6775a467efe40ba3c98aL180 |
@chriseppstein The change in this commit definitely helps! Good deal. One headache-inducing problem: I'm picking up Eyeglass a month later after shipping a major project, and now I can't even successfully import anything. For example:
So…relative imports within an Eyeglass module are now failing? I'm unsure, and I realize this thread is minorly digressing into a mini-support issue, but the fact is that I don't know how to troubleshoot this, and if I don't, I can't possibly, for example, help coworkers with other projects reliant on Eyeglass (sad face). I should add: I know @eoneill mentioned some important caveats. I'll add that I'm using |
You can try using This was a regression in Apologies for the inconvenience. See also #69 for some more detail. |
@eoneill No apologies necessary; I know software dev is such a joy sometimes 😝 Unfortunately I'd have to move a bunch of stuff from Gulp to Grunt (and even if that's a good idea, I can't justify it right now), so I may have to wait it out here. Thanks though. |
Ah, yeah, I keep getting Unfortunately, I don't think there's a workaround for |
Actually, I take that back... With In your project's "devDependencies": {
"node-sass": "3.3.3"
} Then in your gulp task, explicitly set that as the compiler for var nodeSass = require("node-sass");
var gulpSass = require("gulp-sass");
gulpSass.compiler = nodeSass;
... |
Fixed in 0.7.0 |
Cache code that is generated to import assets
Per my lament on Twitter, it'd be great if the Eyeglass instance had an attribute or method to list the Eyeglass modules it knows about (and some other information, like their file paths).
The text was updated successfully, but these errors were encountered: