Skip to content

fix(index): runaway promise #269

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

Merged
merged 1 commit into from
Oct 10, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ module.exports = function loader (css, map) {
* @param {String} result Result (JS Module)
* @param {Object} map Source Map
*/
return cb(null, `module.exports = ${JSON.stringify(css)}`, map)
return cb(null, `module.exports = ${JSON.stringify(css)}`, map) || null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cb(null, `module.exports = ${JSON.stringify(css)}`, map)
return null

}
/**
* @memberof loader
Expand All @@ -175,7 +175,7 @@ module.exports = function loader (css, map) {
* @param {String} css Result (Raw Module)
* @param {Object} map Source Map
*/
return cb(null, css, map)
return cb(null, css, map) || null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cb(null, css, map)
return null

Copy link

@DmitriWolf DmitriWolf Sep 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm working on a React app that spits out a long string of broken promise warnings every time I build, and either of these two fixes makes them all go away.
Seems like a trivial fix to a constantly annoying problem.
Please merge one or the other. Thank you.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DmitriWolf Are you also using bluebird ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are!

})
}).catch((err) => {
return err.name === 'CssSyntaxError' ? cb(new SyntaxError(err)) : cb(err)
Expand Down