create-react-app icon indicating copy to clipboard operation
create-react-app copied to clipboard

create-react-app sass sourcemaps not working

Open mustafaabobakr opened this issue 8 years ago • 56 comments

Sass sourcemaps shows only on yarn build

Can we have sourcemaps enabled by default in development ! yarn start

Environment

Node: v11.1.0 yarn: v1.12.1 npm: v6.4.1 Chrome: v70

image

image

mustafaabobakr avatar Nov 04 '18 15:11 mustafaabobakr

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

stale[bot] avatar Dec 05 '18 08:12 stale[bot]

Any estimate for an official fix on this? Thanks.

Syden10 avatar Dec 07 '18 02:12 Syden10

Any Updates on this ? Is there a working workaround ?

mustafaabobakr avatar Dec 10 '18 10:12 mustafaabobakr

I suspect the team isn't moving particularly fast on this (btw team you are doing an excellent job!), because the react approach favours component level styling over a sass approach. However if sass is being support then source maps probably should be too. I'd certainly find it useful!

BenAttenborough avatar Dec 13 '18 11:12 BenAttenborough

Anybody have temporarily solution ? :(

kuangthien avatar Dec 21 '18 05:12 kuangthien

The following did work for me:

  • open node_modules\react-scripts\config\webpack.config.js
  • replace "isEnvProduction" with "isEnvDevelopment" for the css-loader, css-module loader, sass loader and sass module loader (between lines 443 - 500)
  • start development process with "npm start" grafik

agairing avatar Dec 25 '18 14:12 agairing

The following did work for me:

  • open node_modules\react-scripts\config\webpack.config.js
  • replace "isEnvProduction" with "isEnvDevelopment" for the css-loader, css-module loader, sass loader and sass module loader (between lines 443 - 500)
  • start development process with "npm start"

@agairing Those changes would be lost on every npm install so I would advice against ever editing anything inside node_modules

NotAmaan avatar Dec 25 '18 14:12 NotAmaan

@NotAmaan Right. It's just intended as a temporary solution (if you need working source maps - like myself....).

agairing avatar Dec 25 '18 14:12 agairing

bump.

danieltodonnell avatar Jan 03 '19 23:01 danieltodonnell

I tried the solution from @agairing - but the source maps all point to main.scss and not the individual scss files. So there is still something missing.

[edit] process.env.GENERATE_SOURCEMAP needed to be set to true.

clubajax avatar Jan 04 '19 13:01 clubajax

I just saw, that there are also 2 more spots in the "webpack.config.js" configuration file where I did replace isEnvProduction with isEnvDevelopment: grafik

agairing avatar Jan 04 '19 14:01 agairing

Thanks @agairing for the workaround suggestion. As @NotAmaan pointed out, this would be lost on npm install, so not ideal on my end.

Could anyone share some light on whether an official fix is being considered? Would be much appreciated (even if later than sooner, but at least to know if it will be officially fixed eventually)

Also, I've created the following SO post a while back, just in case anyone wanna jump in: https://stackoverflow.com/questions/53450140/create-react-app-sass-source-maps-not-working

Thank you.

Syden10 avatar Jan 16 '19 14:01 Syden10

@syden10, we have #5713 that should fix this.

ianschmitz avatar Jan 16 '19 15:01 ianschmitz

@ianschmitz THANK YOU Will it be available in next release ? or is it available now !

mustafaabobakr avatar Jan 16 '19 18:01 mustafaabobakr

@ianschmitz Thanks so much for the reply!

Tried updating to 2.1.3 yesterday but still wasn't working, would be up on next release?

Syden10 avatar Jan 17 '19 13:01 Syden10

Please follow #5713 for updates.

ianschmitz avatar Jan 17 '19 15:01 ianschmitz

Will do, thanks again.

Syden10 avatar Jan 17 '19 16:01 Syden10

This is fixed in the latest release.

bugzpodder avatar Feb 11 '19 00:02 bugzpodder

This will be reverted because of #6399.

bugzpodder avatar Feb 20 '19 19:02 bugzpodder

Any news on this?

Shaker-Hamdi avatar Mar 05 '19 10:03 Shaker-Hamdi