-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Gatsby V3 - Source maps are not working for the sass example #32214
Comments
@iamthefox I'm having the same issue. Why I think it's a bugThis was a bug in back in Gatsby v1 #778 and fixed, and then reintroduced in Gatsby v2 #6278 and fixed, and now it's here again in v3. Part of a large commit, seems related to the SSR/fast-refresh work but I can't find why it was changed. I guess assuming it would make things faster for dev, Per the comments in those tickets (and unrelated tickets too) it seems eval just doesn't work for CSS source maps. WorkaroundIn your exports.onCreateWebpackConfig = ({ stage, actions }) => {
if (stage === "develop"){
actions.setWebpackConfig({
devtool: `cheap-module-source-map`
});
}
}; |
thank you, that does solves it |
Hi, thanks for the issue! We had to choose
|
@LekoArts thanks for the explanation, but I think it's wrong to close this issue. Per my earlier comment, this was deemed a bug worth fixing in Gatsby 1 & 2. This bug breaks the official SASS example and the Gatsby docs on SASS. You're breaking DX for an unknown amount of performance gain. People expect these things to "just work" in a framework like Gatsby. If the Gatsby team's decision is to keep a bad default, then the workaround should be included in the documentation for the SASS plugin. I spent several hours tracking down the source of this issue. Also it should be documented as a breaking change from Gatsby v2 to v3. |
The solution proposed by @mrazzari works. Glad I found this. |
Preliminary Checks
Description
Official example using-sass is not generating source maps on gatsby v3.
Switching versions in package.json to v2 (as well as downgrading sass plugin) fixes the issue.
Reproduction Link
https://github.com/gatsbyjs/gatsby/tree/master/examples/using-sass
Steps to Reproduce
Expected Result
Styles should be pointing to .scss file
Actual Result
Styles pointing to commons.css file
Environment
Config Flags
No response
The text was updated successfully, but these errors were encountered: