{"action":"created","issue":{"url":"https://api.github.com/repos/sass/node-sass/issues/1291","labels_url":"https://api.github.com/repos/sass/node-sass/issues/1291/labels{/name}","comments_url":"https://api.github.com/repos/sass/node-sass/issues/1291/comments","events_url":"https://api.github.com/repos/sass/node-sass/issues/1291/events","html_url":"https://github.com/sass/node-sass/issues/1291","id":120160325,"number":1291,"title":"Custom importer sass.NULL usage","user":{"login":"kenborge","id":599468,"avatar_url":"https://avatars.githubusercontent.com/u/599468?v=3","gravatar_id":"","url":"https://api.github.com/users/kenborge","html_url":"https://github.com/kenborge","followers_url":"https://api.github.com/users/kenborge/followers","following_url":"https://api.github.com/users/kenborge/following{/other_user}","gists_url":"https://api.github.com/users/kenborge/gists{/gist_id}","starred_url":"https://api.github.com/users/kenborge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kenborge/subscriptions","organizations_url":"https://api.github.com/users/kenborge/orgs","repos_url":"https://api.github.com/users/kenborge/repos","events_url":"https://api.github.com/users/kenborge/events{/privacy}","received_events_url":"https://api.github.com/users/kenborge/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sass/node-sass/labels/API%20-%20Custom%20Importers","name":"API - Custom Importers","color":"009800"},{"url":"https://api.github.com/repos/sass/node-sass/labels/Discussion%20-%20Question","name":"Discussion - Question","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-12-03T12:28:58Z","updated_at":"2015-12-21T12:52:14Z","closed_at":null,"body":"The documentions for custom importers state that \r\n```If an importer does not want to handle a particular path, it should return sass.NULL```\r\n\r\nBut if you implement the importer in a package, that will be used as a dependency, this package will have a dependency on node-sass and have node-sass package in it's node_modules.\r\n\r\nSo when this importer is run from another package, like grunt-sass that has its own dependency on node-sass, the node-sass module used in grunt-sass and in the importer will not be the same object and the object reference equality check in node-sass will fail.\r\n\r\n```javascript \r\nvar result = importer.call(options.context, file, prev, done);\r\n//result will be a sass.NULL from another node-sass object and the === fails\r\nif (result) {\r\n    done(result === module.exports.NULL ? null : result);\r\n}\r\n```\r\n\r\nThis cause node-sass to think all imports are handled by this importer no matter what. "},"comment":{"url":"https://api.github.com/repos/sass/node-sass/issues/comments/166297449","html_url":"https://github.com/sass/node-sass/issues/1291#issuecomment-166297449","issue_url":"https://api.github.com/repos/sass/node-sass/issues/1291","id":166297449,"user":{"login":"saper","id":248374,"avatar_url":"https://avatars.githubusercontent.com/u/248374?v=3","gravatar_id":"","url":"https://api.github.com/users/saper","html_url":"https://github.com/saper","followers_url":"https://api.github.com/users/saper/followers","following_url":"https://api.github.com/users/saper/following{/other_user}","gists_url":"https://api.github.com/users/saper/gists{/gist_id}","starred_url":"https://api.github.com/users/saper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saper/subscriptions","organizations_url":"https://api.github.com/users/saper/orgs","repos_url":"https://api.github.com/users/saper/repos","events_url":"https://api.github.com/users/saper/events{/privacy}","received_events_url":"https://api.github.com/users/saper/received_events","type":"User","site_admin":false},"created_at":"2015-12-21T12:52:14Z","updated_at":"2015-12-21T12:52:14Z","body":"My patch uses `null` everywhere and aliases `sass.NULL` and `sass.sass_types.Null.NULL` to `null` for compatibility."}}